home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MPW 411 / MPWHelp < prev    next >
Encoding:
Text File  |  1990-07-19  |  372.5 KB  |  10,612 lines  |  [TEXT/MPS ]

  1. æKY CopyrightNotice
  2. æC  Copyright Apple Computer, Inc. 1986-1990, All rights reserved.
  3. 411 - MPW Help - MPW 3.2 Beta Release.
  4. Tuesday, May 22, 1990 11:53:46 AM
  5.  
  6. MPW 3.2 Help Summaries
  7.  Help information is available for each of the MPW commands.  
  8.  To see the list of commands select Help and type command - 1. In addition, 
  9.  brief descriptions of Expressions, Patterns, Selections, Characters,
  10.  Shortcuts, Variables, and Projector are also included.
  11.  
  12.  To see Help summaries, Select one of the following and type command - 1
  13.  
  14.  a commandName  # information about commandName
  15.  Commands       # a list of commands
  16.  Expressions    # summary of expressions
  17.  Patterns       # summary of patterns (regular expressions)
  18.  Selections     # summary of selections
  19.  Characters     # summary of MPW Shell special characters
  20.  Shortcuts      # summary of MPW Shell shortcuts
  21.  Variables      # summary of the standard MPW shell variables
  22.  Projector      # summary of Projector, a project/source control system
  23.  
  24.  Copyright Apple Computer, Inc. 1986-1990
  25.  All rights reserved.
  26.  
  27. æKY Commands
  28. æC              MPW Commands -- A list of MPW executable commands
  29.  
  30.  AddMenu         # add a menu item
  31.  Adjust          # adjust lines
  32.  Alert           # display an alert box
  33.  Alias           # define or write command aliases
  34.  Align           # align text to left margin
  35.  Asm             # MC68xxx Macro Assembler
  36.  AsmCvtIIGS      # converts APW Assembler source files to AsmIIGS format
  37.  AsmIIGS         # the MPW IIGS Assembler
  38.  AsmMatIIGS      # Assembler source formatter
  39.  Backup          # folder file backup
  40.  Beep            # generate tones
  41.  Begin           # group commands
  42.  Break           # break from For or Loop
  43.  Browser         # invoke Marker Browser
  44.  BuildCommands   # show build commands
  45.  BuildMenu       # create the Build menu
  46.  BuildMenuIIGS   # adds CreateMakeIIGS to the Build menu
  47.  BuildProgram    # build the specified program
  48.  C               # C compiler
  49.  Canon           # canonical spelling tool
  50.  Catenate        # concatenate files
  51.  CFront          # C++ to C translator
  52.  CheckIn         # check a file into a project
  53.  CheckOut        # check a file out from a project
  54.  CheckOutDir     # specify the directory where checked out files will placed
  55.  Choose          # choose or list network file server volumes and printers
  56.  CIIGS           # the MPW IIGS C Compiler
  57.  Clear           # clear the selection
  58.  Close           # close specified windows
  59.     CMarker         # generate Mark commands for C and C++ function definitions
  60.  Commando        # present a dialog interface for commands
  61.  Compare         # compare text files
  62.  CompareFiles    # compare text files and interactively view differences
  63.  CompareRevisions# compare two revisions of a file in a project
  64.  Confirm         # display a confirmation dialog box
  65.  Continue        # continue with next iteration of For or Loop
  66.  Copy            # copy selection to Clipboard
  67.  Count           # count lines and characters
  68.  CPlus           # script to compile C++ source
  69.  CreateMake      # create a simple makefile
  70.  CreateMakeIIGS  # creates Make files that build IIGS programs
  71.  Cut             # copy selection to Clipboard and delete it
  72.  Date            # write the date and time
  73.  Delete          # delete files and directories
  74.  DeleteMenu      # delete user-defined menus and menu items
  75.  DeleteNames     # delete user-defined symbolic names
  76.  DeletePane            # delete a pane from the window
  77.     DeleteRevisions # delete previous revisions of files in a project
  78.  DeRez           # resource decompiler
  79.  DeRezIIGS       # resource decompiler for Apple IIGS
  80.  Directory       # set or write the default directory
  81.  DirectoryMenu   # create the Directory menu
  82.  DoIt            # highlight and execute a series of shell commands
  83.  DumpCode        # write formatted CODE resources
  84.  DumpFile        # display contents of any file
  85.  DumpObj         # write formatted object file
  86.  DumpObjIIGS     # dumps OMF files
  87.  Duplicate       # duplicate files and directories
  88.  DuplicateIIGS   # moves files between Mac and GS/OS volumes
  89.  Echo            # echo parameters
  90.  Eject           # eject volumes
  91.  Entab           # convert runs of spaces to tabs
  92.  Equal           # compare files and directories
  93.  Erase           # initialize volumes
  94.  Evaluate        # evaluate an expression
  95.  Execute         # execute command file in the current scope
  96.  Exists          # confirm the existence of a file or directory
  97.  Exit            # exit from a command file
  98.  Export          # make variables available to commands
  99.  ExpressIIGS     # converts files from OMF to ExpressLoad format
  100.  FileDiv         # divide a file into several smaller files
  101.  Files           # list files and directories
  102.  Find            # find and select a text pattern
  103.  Flush           # flush the tools that the Shell has cached
  104.  For             # repeat commands once per parameter
  105.  Format          # set or display formatting options for a window
  106.  Get             # get information about a key word from a data file
  107.  GetErrorText    # display error messages based on message number
  108.  GetFileName     # display a Standard File dialog box
  109.  GetListItem     # display items for selection in a dialog box
  110.  Help.MPW        # write summary information
  111.  If              # conditional command execution
  112.  Lib             # combine object files into a library file
  113.  Line            # find line in the target window
  114.  Link            # link an application, tool, or resource
  115.  LinkIIGS        # the MPW IIGS Linker
  116.  Loop            # repeat commands until Break
  117.  Make            # build up-to-date version of a program
  118.  MakeErrorFile   # create error message textfile
  119.  MakeBinIIGS     # converts Load files to Binary files
  120.  MakeLibIIGS     # creates IIGS Library files
  121.  Mark            # assign a marker to a selection
  122.  Markers         # list markers
  123.  MatchIt         # semi-intelligent language sensitive bracket matcher
  124.  MergeBranch     # merge a branch revision onto the trunk
  125.  ModifyReadOnly  # enables a read-only Projector file to be edited
  126.  Mount           # mount volumes
  127.  MountProject    # mount projects
  128.  Move            # move files and directories
  129.  MoveWindow      # move window to h,v location
  130.  NameRevisions   # define a symbolic name
  131.  New             # open a new window
  132.  Newer           # compare modification dates of files
  133.  NewFolder       # create a new folder
  134.  NewProject      # create a new project
  135.  Open            # open file(s) in window(s)
  136.  OrphanFiles     # remove Projector information from a list of files
  137.  Parameters      # write parameters
  138.  Pascal          # Pascal compiler
  139.  PascalIIGS      # the MPW IIGS Pascal Compiler
  140.  PasMat          # Pascal programs formatter
  141.  PasRef          # Pascal cross-referencer
  142.  Paste           # replace selection with Clipboard contents
  143.  PerformReport   # generate a performance report
  144.  Position        # display current line position
  145.  Print           # print text files
  146.  ProcNames       # display Pascal procedure and function names
  147.  Project         # set or write the current project
  148.  ProjectInfo     # display information about a Project
  149.  Quit            # quit MPW
  150.  Quote           # echo parameters, quoting if needed
  151.  Rename          # rename files and directories
  152.  Replace         # replace the selection
  153.  Request         # request text from a dialog box
  154.  ResEqual        # compares the resources in two files
  155.  ResEqualIIGS    # compares the resources in two IIGS files
  156.  Revert          # revert window to previous saved state
  157.  Rez             # resource compiler
  158.  RezDet          # detect inconsistencies in resources
  159.  RezIIGS         # resource compiler
  160.  RotateWindows   # send active (frontmost) window to back
  161.  Save            # save specified windows
  162.  SaveOnClose     # set save behavior when closing windows
  163.  Search          # search files for pattern
  164.  Set             # define or write Shell variables
  165.  SetDirectory    # set the default directory
  166.  SetFile         # set file attributes
  167.  SetPrivilege    # set access privileges for directories on file servers
  168.  SetVersion      # maintain version and revision number
  169.  Shift           # renumber command file positional parameters
  170.  ShowSelection   # place the selection within an editor window
  171.  Shutdown        # power down or restart the machine
  172.  SizeWindow      # set a window's size
  173.  Sort            # sort or merge lines of text
  174.  StackWindows    # arrange windows diagonally
  175.  StreamEdit      # scriptable text editor
  176.  Target          # make a window the target window
  177.  TileWindows     # arrange windows in a tiled fashion
  178.  TransferCkid    # move Projector information from one file to another
  179.  Translate       # translate characters
  180.  Unalias         # remove aliases
  181.  Undo            # undo the last edit
  182.  Unexport        # remove variable definitions from the export list
  183.  Unmark          # remove a marker from a window
  184.  Unmount         # unmount volumes
  185.  UnmountProject  # unmount projects
  186.  Unset           # remove Shell variable definitions
  187.  UserVariables   # uses Commando to set all the user variables
  188.  Version                                    # print the version of the MPW Shell
  189.  Volumes         # list mounted volumes
  190.  WhereIs         # find the location of a file
  191.  Which           # determine which file the shell will execute
  192.  Windows         # list windows
  193.  ZoomWindow      # enlarge or reduce a window's size
  194.  
  195. æKY Help
  196. MPWHelp
  197.  
  198. æKL About411
  199. Characters
  200. Commands
  201. Expressions
  202. Patterns
  203. Projector
  204. Selections
  205. Shortcuts
  206. Variables
  207.  
  208. AddMenu
  209. Adjust
  210. Alert
  211. Alias
  212. Align
  213. Asm
  214. AsmCvtIIGS
  215. AsmIIGS
  216. AsmMatIIGS
  217. Backup
  218. Beep
  219. Begin
  220. Break
  221. BuildCommands
  222. BuildMenu
  223. BuildMenuIIGS
  224. BuildProgram
  225. C
  226. Canon
  227. Catenate
  228. CFront
  229. CheckIn
  230. CheckOut
  231. CheckOutDir
  232. Choose
  233. CIIGS
  234. Clear
  235. Close
  236. CMarker
  237. Commando
  238. Compare
  239. CompareFiles
  240. CompareRevisions
  241. Confirm
  242. Continue
  243. Copy
  244. Count
  245. CPlus
  246. CreateMake
  247. CreateMakeIIGS
  248. Cut
  249. Date
  250. Delete
  251. DeleteMenu
  252. DeleteNames
  253. DeletePane
  254. DeleteRevisions
  255. DeRez
  256. DeRezIIGS
  257. Directory
  258. DirectoryMenu
  259. DoIt
  260. DumpCode
  261. DumpFile
  262. DumpObj
  263. DumpObjIIGS
  264. Duplicate
  265. DuplicateIIGS
  266. Echo
  267. Eject
  268. Entab
  269. Equal
  270. Erase
  271. Evaluate
  272. Execute
  273. Exists
  274. Exit
  275. Export
  276. ExpressIIGS
  277. FileDiv
  278. Files
  279. Find
  280. Flush
  281. For
  282. Format
  283. Get
  284. GetErrorText
  285. GetFileName
  286. GetListItem
  287. Help.MPW
  288. If
  289. Lib
  290. Line
  291. Link
  292. LinkIIGS
  293. Loop
  294. Make
  295. MakeBinIIGS
  296. MakeErrorFile
  297. MakeLibIIGS
  298. Mark
  299. Markers
  300. MatchIt
  301. MergeBranch
  302. ModifyReadOnly
  303. Mount
  304. MountProject
  305. Move
  306. MoveWindow
  307. NameRevisions
  308. New
  309. Newer
  310. NewFolder
  311. NewProject
  312. Open
  313. OrphanFiles
  314. Parameters
  315. Pascal
  316. PascalIIGS
  317. PasMat
  318. PasRef
  319. Paste
  320. PerformReport
  321. Position
  322. Print
  323. ProcNames
  324. Project
  325. ProjectInfo
  326. Quit
  327. Quote
  328. Rename
  329. Replace
  330. Request
  331. ResEqual
  332. ResEqualIIGS
  333. Revert
  334. Rez
  335. RezIIGS
  336. RezDet
  337. RotateWindows
  338. Save
  339. SaveOnClose
  340. Search
  341. Set
  342. SetDirectory
  343. SetFile
  344. SetPrivilege
  345. SetVersion
  346. Shift
  347. ShowSelection
  348. Shutdown
  349. SizeWindow
  350. Sort
  351. StackWindows
  352. StreamEdit
  353. Target
  354. TileWindows
  355. TransferCkid
  356. Translate
  357. Unalias
  358. Undo
  359. Unexport
  360. Unmark
  361. Unmount
  362. UnmountProject
  363. Unset
  364. UserVariables
  365. Version
  366. Volumes
  367. WhereIs
  368. Which
  369. Windows
  370. ZoomWindow
  371. æKY Variables
  372. æC                  Variables defined by the MPW Shell:
  373.  
  374.  {Active}          full pathname of current active window
  375.  {Aliases}         list of all defined aliases
  376.  {Boot}            volume name of the boot disk
  377.  {Command}         full pathname of the last command executed
  378.  {MPW}             full pathname of the Macintosh Programmer's Workshop.
  379.  {ShellDirectory}  full pathname of the directory that contains the MPW Shell
  380.  {Status}          result of the last command executed (0 means successful)
  381.  {SystemFolder}    full pathname of the system folder
  382.  {Target}          full pathname of the target window
  383.  {User}            the current user name (initialized to the “Chooser” name)
  384.  {Windows}         list of current windows     
  385.  {Worksheet}       full pathname of the Worksheet window
  386.  
  387.  Variables used by the MPW Shell:
  388.  
  389.  {Commando}        name of the commando tool
  390.  {Commands}        list of directories to search for commands
  391.  {DirectoryPath}   list of common directories to speed changing directories
  392.  {Echo}            control the echoing of commands to diagnostic output
  393.  {Exit}            control script termination based on {Status}
  394.  {IgnoreCmdPeriod} control use of cmd-. during critical sections
  395.  {Test}            control execution of tools and applications
  396.  {AutoIndent}      auto indent setting used for new windows
  397.  {CaseSensitive}   control case sensitivity for searching
  398.  {Font}            font used for new windows
  399.  {FontSize}        font size used for new windows
  400.  {NewWindowRect}   window rectangle used for new windows (top,left,bottom,right)
  401.  {PrintOptions}    options used by the print menu commands
  402.  {SearchBackward}  control direction of searching
  403.  {SearchType}      control type of searching (literal/word/expression)
  404.  {SearchWrap}      control wrap-around search
  405.  {StackOptions}    options used by the Stack Windows menu command
  406.  {Tab}             tab size used for new windows
  407.  {TileOptions}     options used by the Tile Windows menu command
  408.  {WordSet}         set of characters that constitue a word
  409.  {ZoomWindowRect}  window rectangle used for a zoomed window (top,left,bottom,right)
  410.  
  411.  Variables automatically set before script execution:
  412.  
  413.  {0}               name of the currently executing script
  414.  {1}, {2}, … {n}   first, second, and nth parameter to the script
  415.  {#}               number of parameters
  416.  {Parameters}      equivalent to {1} {2} … {n}
  417.  {"Parameters"}    equivalent to "{1}" "{2}" … "{n}"
  418.  
  419.  Variables used for libraries and include files:
  420.  
  421.  {AIncludes}       directories to search for assemby-language include files        
  422.  {CIncludes}       directories to search for C include files
  423.  {CLibraries}      directory containing C library files
  424.  {Libraries}       directory containing shared library files
  425.  {PInterfaces}     directory containing Pascal interface files
  426.  {PLibraries}      directory containing Pascal library files
  427.  {RIncludes}       directory containing Rez include files
  428.  
  429. æKY Characters
  430. æC   The characters listed below have special meanings in the command language.
  431.  
  432.  
  433.  Space           Space separates words.
  434.  Tab             Tab also separates words.
  435.  
  436.  Return          Return separates commands.
  437.  ;               Semicolon also separates commands.
  438.  |               Pipe separates commands and pipes output to input.
  439.  &&              And separates commands, executing second if first succeeds.
  440.  ||              Or separates commands, executing second if first fails.
  441.  (…)             Parenthesis group commands.
  442.                  Parenthesis also group characters in filename patterns.
  443.  
  444.  #               Comment begins comments.
  445.  
  446.  ∂               Escape (Option-D) quotes the following character.
  447.  '…'             Single quote quotes all other characters.
  448.  "…"             Double quote quotes all characters except ∂, {, and `.
  449.  /…/             Slash quotes all characters except ∂, {, and `.
  450.  \…\             Backslash quotes all characters except ∂, {, and `.
  451.  
  452.  {…}             Braces denote variable substitution.
  453.  `…`             Backquotes denote command substitution.
  454.  
  455.  ?               Question mark matches any character in filename patterns.
  456.  ≈               Approximately (Option-X) matches any string in patterns.
  457.  […]             Brackets enclose character sets in filename patterns.
  458.  *               Star indicates zero or more repetitions in patterns.
  459.  +               Plus indicates one or more repetitions in patterns.
  460.  «…»             European quotes (Option-\ and Option-Shift-\) enclose
  461.                  repeat counts.
  462.  
  463.  <               Less-than indicates an input file specification.
  464.  >               Greater-than indicates an output file specification.
  465.  >>              Indicates appending to an output file specification.
  466.  ≥               Greater-than-or-equal indicates a diagnostic specification.
  467.  ≥≥              Indicates appending to a diagnostic file specification.
  468.  ∑               Capital sigma (option-w) indicates both an output file and
  469.                  diagnostic output file specification.
  470.  ∑∑              Indicates appending to the output and diagnostic file
  471.                  specification.
  472.  
  473.  …               Elipsis (Option-;) signals the Shell to use Commando
  474.  
  475. æKY Expressions
  476. æC  Expressions
  477.  
  478.  Numbers may be expressed in decimal, hexadecimal, octal, or
  479.  binary.  Any of the following formats may be used:
  480.  
  481.  [0-9]+          decimal number
  482.  0x[0-9a-f]+     hexadecimal number
  483.  $[0-9a-f]+      hexadecimal number
  484.  0[0-7]+         octal number
  485.  0b[01]+         binary number
  486.  
  487.  The operators listed below are used in expressions in the
  488.  Evaluate, If, Else If, Break, Continue, and Exit commands. 
  489.  
  490.  Alternate spellings of several operators are provided.
  491.  All of the operators are evaluated from left to right.
  492.  Operators with the highest precedence are listed first,
  493.  and operators in the same group have equal precedence.
  494.  
  495.  
  496.  (…)             expression grouping
  497.  
  498.  -               unary negation
  499.  ~               bitwise negation
  500.  !    NOT  ¬     logical NOT (¬ is Option-L)
  501.  
  502.  *               multiplication
  503.  ÷    DIV        division (÷ is Option-/)
  504.  %    MOD        modulus division
  505.  
  506.  +               addition
  507.  -               subtraction
  508.  
  509.  <<              shift left
  510.  >>              shift right
  511.  
  512.  <               less than
  513.  <=   ≤          less than or equal to (≤ is Option-<)
  514.  >               greater than
  515.  >=   ≥          greater than or equal to (≥ is Option->)
  516.  
  517.  ==              equal
  518.  !=   <>   ≠     not equal (≠ is Option-=)
  519.  =~              equal to a pattern
  520.  !~              not equal to a pattern
  521.  
  522.  &               bitwise AND
  523.  
  524.  ^               bitwise XOR
  525.  
  526.  |               bitwise OR
  527.  
  528.  &&   AND        logical AND
  529.  
  530.  ||   OR         logical OR
  531.  
  532. æKY Selections
  533. æC      Selections - selections specify a selection or insertion point
  534.  
  535.  §                    current selection (Option-6)
  536.  n                    line number n
  537.  !n                   line n lines after end of current selection
  538.  ¡n                   line n lines before start of selection (Option-1)
  539.  position             position (defined below)
  540.  markerName           selection marked by markerName
  541.  pattern              pattern  (defined below)
  542.  (selection)          selection grouping
  543.  selection:selection  both selections and everything in between
  544.  
  545. position - positions specify an insertion point
  546.  
  547.  •                    position before first character of file (Option-8)
  548.  ∞                    position after last character of file (Option-5)
  549.  Δselection           position before first character of selection (Option-J)
  550.  selectionΔ           position after last character of selection (Option-J)
  551.  selection!n          position n characters after selection
  552.  selection¡n          position n characters before selection (Option-!)
  553.  
  554. pattern - patterns specify characters to be matched
  555.  
  556.  /entireRE/           regular expression - search forward
  557.  \entireRE\           regular expression - search backward
  558.  
  559.  Help Patterns           # See "Help Patterns" for more information.
  560.  
  561. æKY Patterns
  562. æC  Patterns - Patterns specify characters to be matched
  563.  /entireRE/           regular expression - search forward
  564.  \entireRE\           regular expression - search backward
  565.  
  566. entireRE
  567.  
  568.  •RE                  regular expression at beginning of line (Option-8)
  569.  RE∞                  regular expression at end of line (Option-5)
  570.  RE                   regular expression
  571.  
  572. RE
  573.  
  574.  simpleExpr           simple regular expression - defined below
  575.  (RE)®digit           tagged RE - refer to match as ®digit (Option-R)
  576.  'string'             literal - no characters within '…' are special
  577.  "string"             literal - only ∂, {, and ` are special within "…"
  578.  RE1RE2               regular expression RE1 followed by RE2
  579.  
  580. simpleExpr
  581.  
  582.  (RE)                 regular expression grouping
  583.  charExpr             single character regular expression - defined below
  584.  simpleExpr*          simple expression zero or more times
  585.  simpleExpr+          simple expression one of more times
  586.  simpleExpr«n»        simple expression n times (Option-\, Option-Shift-\)
  587.  simpleExpr«n,»       simple expression at least n times
  588.  simpleExpr«n1,n2»    simple expression at least n1, at most n2 times
  589.  
  590. charExpr
  591.  
  592.  character            character (unless it has special meaning)
  593.  ∂character           character - defeats any special meaning (Option-D)
  594.  ?                    any character except Return
  595.  ≈                    zero or more characters, except Return (Option-X)
  596.  [charList]           any character in the list
  597.  [¬charList]          any character not in the list (Option-L)
  598.  
  599. charList
  600.  
  601.  [                    [ first in the list represents itself
  602.  ]                    ] first in the list represents itself
  603.  -                    - first in the list represents itself
  604.  character            character
  605.  charList character   list of characters
  606.  character-character  character range (e.g. A-Z)
  607.  
  608. æKY ShortCuts
  609. æC   The following is a list of MPW Shell shortcuts:
  610.  
  611.  Double click        select word
  612.  Triple click        select line
  613.  Double Clicking on any of the characters (,),[,],{,},',",/,\,` will select
  614.      everything between the character and its mate.
  615.  
  616.  UpArrow             move selection point one line above current selection
  617.  DownArrow           move selection point one line below current selection
  618.  RightArrow          move selection point one character to the right
  619.  LeftArrow           move selection point one character to the left
  620.  
  621.  Opt-LeftArrow                            move selection point one word to the left
  622.  Opt-RightArrow      move selection point one word to the right
  623.  CMD-Shift-UpArrow   move selection point to top of file
  624.  CMD-Shift-DownArrow move selection point to bottom of file
  625.  CMD-DownArrow             move selection point down one screen size
  626.  CMD-RightArrow            move selection point to right edge of current line
  627.  CMD-UpArrow               move selection point up one screen size
  628.     CMD-LeftArrow             move selection point to left edge of current line
  629.  
  630.  Backspace                                            delete character to the left
  631.  Clear                     delete character to the right
  632.  Opt-Backspace             delete word to the left
  633.  Opt-Clear              delete word to the right
  634.  CMD-Backspace             delete from current selection to end of file
  635.  CMD-Shift-Backspace    delete from current selection to top of file
  636.  Opt-Shift-Backspace    delete word to the right
  637.  
  638.  
  639.  Searching shortcuts
  640.      CMD-Shift-G     reverse the direction of "Find Same"
  641.      CMD-Shift-H     reverse the direction of "Find Selection"
  642.      CMD-Shift-T     reverse the direction of "Replace Same"
  643.      Holding down Shift while selecting OK will reverse the direction 
  644.          of "Find" and "Find and Replace"
  645.  
  646.  Holding down Option while selecting "Tile Windows" or "Stack Windows"
  647.      will include the worksheet in the tiling or stacking
  648.  Holding down Option while pressing Return will disable auto-indent
  649.      for that line.
  650.  Holding down Option while pressing Enter will invoke Commando on that
  651.      command line.
  652.  
  653.  In Dialogs without an EditText item
  654.      Y               Yes
  655.      N               No
  656.      CMD .           Cancel
  657.      ESC             Cancel
  658.  
  659. æKY Projector
  660. æC   Projector is a collection of built–in MPW commands and windows that
  661.  help programmers (both individuals and teams) control and account for
  662.  changes to all the files (documentation, source, applications etc.)
  663.  associated with a software project.
  664.  
  665.  Here is a brief summary of the commands (the CheckIn, CheckOut, and
  666.  NewProject commands also have windows that can be opened using the
  667.  “-w” option to the respective command):
  668.  
  669.  CheckIn          # check a file into a project
  670.  CheckOut         # check a file out from a project
  671.  CheckOutDir      # specify the directory where checked out files will placed
  672.  CompareRevisions # compare two revisions of a file in a project
  673.  DeleteNames      # delete user-defined symbolic names
  674.  DeleteRevisions  # delete previous revisions of files in a project
  675.  MergeBranch      # merge a branch revision onto the trunk
  676.  ModifyReadOnly   # enables a read-only Projector file to be edited
  677.  MountProject     # mount projects
  678.  NameRevisions    # define a symbolic name
  679.  NewProject       # create a new project
  680.  OrphanFiles      # remove Projector information from a list of files
  681.  Project          # set or write the current project
  682.  ProjectInfo      # display information about a Project
  683.  TransferCkid     # move Projector information from one file to another
  684.  UnmountProject   # unmount projects
  685.  
  686.                              Examples
  687.  
  688.   The command
  689.  
  690.   Project
  691.  
  692.   causes the current project name to be written to standard output.
  693.   To change the current project to OurProject, use
  694.  
  695.   Project OurProject
  696.  
  697.  
  698.                              See also 
  699.  
  700.   NewProject, MountProject.
  701.  
  702.  
  703. æKY About411
  704. æC         
  705. About “411”
  706. “411” provides a way for Macintosh developers to achieve rapid retrieval of software de-
  707. velopment information while using Apple's MPW development system. The access can be 
  708. via menus and command keys or from command line entries.  The software development 
  709. information includes language-specific Inside Macintosh documentation, Tech Notes, 
  710. MPW command descriptions and Resource information.  In addition a facility for automatic 
  711. insertion of Toolbox call templates is provided.
  712.  
  713. “411” can also be customized and extended and new information can be added.  The help 
  714. files of “411” may be either local or on a shared file server.
  715.  
  716. Setting up “411”
  717.  
  718. “411” consists of a installation instructions file (Read Me First), a special UserStartup 
  719. script (UserStartup•Help), an installation script (Install411), and a set of help files 
  720. along with their .index files. It makes use of a new MPW tool, Get, which was written to 
  721. support “411” but can be used independently.  The “411” folder holds the help files, their 
  722. index files and a “Tools” folder.  
  723.  
  724. An important decision to make in setting up “411” is whether to place the “411” Help files 
  725. on a server or on your local hard disk.  Since these files are large (over 9 Meg total) some 
  726. thought should go into deciding which files to use and whether to transfer them to your 
  727. hard disk or, if you are connected to a network, to a file server.  The most obvious candi-
  728. date for removal is either CIncludesHelp or PInterfacesHelp.  If you are not developing in 
  729. both C and Pascal, one of them will probably not be needed. Placing the help files on a 
  730. local hard disk will provide better access speed but will use significant disk space.  If you 
  731. have access to a file server and several persons want to access “411” Help, it may be best 
  732. to move the “411” folder to the file server.
  733.  
  734. Set up “411” by writing the following two commands to your MPW WorkSheet and 
  735. executing them:
  736.  
  737. <rls>:Install411 <info>
  738. Execute "{ShellDirectory}"UserStartup•Help
  739.  
  740. where <rls> denotes the path to the “411” files on the release medium and <info> denotes 
  741. the volume on which the user wishes the “411” Help files to reside.  If <info> is omitted, 
  742. the installation will be to the volume that begins the path <rls>.  (In this latter case, the 
  743. data files are not duplicated because they are already residing in the desired place.)
  744. For example, if “411” were to be released in a folder named 411Stuff on a CD named MPW 
  745. 3.2 Release, and the user wanted “411” to be installed on a volume named HelpMe, then 
  746. the commands to be executed would read:
  747.  
  748. 'MPW 3.2 Release:411Stuff:Install411' HelpMe:
  749. Execute "{ShellDirectory}"UserStartup•Help
  750.  
  751. The effect of the first of the above commands is to create the folder HelpMe:411: and to 
  752. copy to it all of the “411” files.  It then, additionally, copies the new Get tool to the user’s 
  753. MPW Tools folder, copies UserStartup•Help to the MPW folder, and creates a folder 
  754. called Help Folder in the MPW folder.  This latter folder contains at this time a file called 
  755. Help_Folder whose contents is the single line: HelpMe:411:, i.e. the name of the folder 
  756. containing the “411” information.  The effect of the second of the above commands is to 
  757. add the “411” menu to the menu bar, and to add one more file to the Help Folder,  a file 
  758. called Help_Files which  contains the names of all of the “411” data files in the order in 
  759. which they will be interrogated, e.g.:
  760.  
  761. HelpMe:411:CIncludesHelp
  762. HelpMe:411:InsideMacintoshHelp
  763. HelpMe:411:MPWHelp
  764. HelpMe:411:PInterfacesHelp
  765. HelpMe:411:ResourcesHelp
  766. HelpMe:411:TechNotesHelp
  767.  
  768.  
  769. Using the “411” Help menu
  770.  
  771. “411” works only from within the MPW development environment.  When “411” is prop-
  772. erly set up, there should be a 411 menu on the MPW menu bar.  If there has been no 
  773. change to the UserStartup•Help script, the Help menu looks like this:
  774.  
  775.  
  776.  411 Menu
  777.     
  778.        Build   Format   Directory  411                   
  779.        ________________________________________________
  780.           HD:MPW:Worksheet       |  Contents          |
  781.        __________________________|  Look up    CMD-E  |
  782.                                  |  Template   CMD-1  |
  783.                                  |  Show Keys         |
  784.                                  |  Search            |
  785.                                  |____________________|
  786.                                  |  Set First File ...|
  787.                                  |   Set 411 Files ...|
  788.                                  |  Edit 411 Files ...|
  789.                                  |____________________|
  790.                                  |  About 411 ...     |
  791.                                  |____________________|
  792.  
  793. The menu items Look up and Template search all of the files listed in Help_Files; 
  794. the items Contents, Show Keys, and Search look only at the first file in the 
  795. Help_Files list.  This first file is known as the currently selected file.  It can be changed 
  796. by using the Set First File menu item.
  797.  
  798.  
  799. Contents
  800.  
  801. This menu item lets you see a list of the Help file’s table of contents.  For example, if the 
  802. CIncludesHelp file is the currently selected Help file, then selecting the “Contents” menu 
  803. item, causes a list of the ToolBox managers to appear in the Help window.
  804. ————————————————————————————————————————————————————————————————————————
  805. HelpMe:411:CIncludesHelp           Look up… "Help" 
  806. ————————————————————————————————————————————————————————————————————————
  807. Appletalk.h       FixMath.h         Palettes.h     Serial.h
  808. Controls.h        Fonts.h           Perf.h         ShutDown.h
  809. CursorCtl.h       Globals           Picker.h       Slots.h
  810. Desk.h            Graf3D.h          Printing.h     Sound.h
  811. Deskbus.h         HyperXCmd.h       Quickdraw.h    Start.h
  812. ...
  813.  
  814. Note that you can obtain the same information by selecting the key word "Help" (or the 
  815. name of the help file, e.g. CIncludesHelp) and then selecting the Look up menu item.  
  816.  
  817.  
  818. Look up  (Command-E)
  819.  
  820. This menu item lets you look up information stored in the help files; the search starts with 
  821. the currently selected file (See Set First File...).   For example, if you choose (see 2 
  822. below) the word FindWindow and then select the Look up menu item (or type Command-E) the 
  823. following information will appear in the Help window:
  824.  
  825. ------------------------------------------------------------------------
  826. HelpMe:411:CIncludesHelp     Look up… "findwindow" 
  827. ------------------------------------------------------------------------
  828. short findwindow(Point *thePoint,WindowPtr *theWindow);
  829. Type: Function
  830. File {CIncludes}Windows.h
  831. Trap Number A92C
  832. InsideMacintosh Reference: FindWindow function I-287, P-35, 114, 170 
  833. FindWindow procedure  V-208
  834. [Macintosh Plus, Macintosh SE, Macintosh II]
  835.  
  836. When a mouse-down event occurs, the application should call FindWindow 
  837. with thePt equal to the point where the mouse button was pressed (in 
  838. global coordinates, as
  839. ...
  840. Thus, to get help for a given key word:
  841.  
  842. 1) Choose the Help file you want information from by using the Set First File... menu 
  843. item to make the desired file the first file (currently selected file) in the help file list.  
  844. (Skip this step if the help file is already selected, or if the order of search does not 
  845. matter.)
  846.  
  847. 2) Click on a word in the active window.  You may want to type in the word you want to 
  848. look up instead.  If the item is just one word, it will be automatically selected if the 
  849. insertion point is adjacent to or within the word.  Only if a multiple word item is to be 
  850. looked up is it necessary to do a manual selection of the entire item.  (Note:  the means 
  851. you don’t have to double-click.  Also you don’t have to type the entire word, just 
  852. enough letters to allow 411 to distinguish between the word you want and any other in 
  853. the current Help file.)  
  854.  
  855. 3) Select the menu item Look up or type Command-E.  This triggers a search through the help 
  856. files, in the order in which they are listed,  looking for the selected key word.  If the 
  857. search is successful then a window named Help (a file in the MPW directory) is opened 
  858. and the information associated with the key word is displayed, along with an indication 
  859. of the file in which the key word was found.
  860.  
  861. Remember, the Look up menu item simply looks for the current selection in the active 
  862. window.
  863.  
  864. Since numbers are keywords only in TechNotesHelp, selecting a number will retrieve the 
  865. Macintosh Technical note of that number.
  866.  
  867. The header, which is placed above the “Contents” information, shows the help file that was 
  868. used.  To the right of the file name is a message indicating the key word on which the 
  869. search was made.  A mark is set to this (selected) key word in the file Help to aid the user 
  870. in subsequent scanning of Help for previously gathered information.  
  871.  
  872. A slight modification of UserStartup•Help causes the header to list all the “411” files in 
  873. the order in which they are searched, with  the words on the right (Look up…) printed on 
  874. the line bearing the name of the file in which the item was actually found.  (See 
  875. Customizing “411” below.)
  876.  
  877.  
  878. Template  (Command-1)
  879.  
  880. This menu item lets you replace a toolbox function call such as FindWindow with the 
  881. template for that function.  For example if you were to select “FindWindow” and choose 
  882. the 'Template' menu item (or type Command-1), then your "FindWindow" selection in the Active 
  883. window would be replaced by:
  884.  
  885. short myVariable = findwindow((Point *)thePoint,(WindowPtr *)theWindow);
  886.  
  887. Both C and Pascal templates are available.  Use Set First File... on the 411 menu to 
  888. choose a language by selecting either CIncludesHelp or PInterfacesHelp.
  889.  
  890.  
  891. Show keys…
  892.  
  893. This menu item lets you list all of the keys in the currently selected help file which begin 
  894. with the word you have selected in the Request dialog.  For example, selecting this menu 
  895. and then typing the two letters “fs” when CIncludesHelp is your current (first listed) help 
  896. file, produces a list of all of the HFS calls that begin with “FS”, i.e. FSClose, ...
  897.  
  898.  
  899. Search…
  900.  
  901. This menu item lets you search the currently selected help file for all occurrences of the 
  902. word you have selected.  The result is a list of names (keys) whose data records contain the 
  903. word.  On a large Help file, e.g. CIncludesHelp, this can take a minute or more.  Only the 
  904. current  (first listed) help file is searched even if no data record containing the word is 
  905. found.
  906.  
  907.  
  908. Set First File…
  909.  
  910. This menu item lets you choose a help file to be the currently selected file.  A dialog win-
  911. dow shows a list of all help files, and you are invited to make a selection.   The selected file 
  912. then becomes the first file in the list that appears in the file Help_Files.  It is then known 
  913. as the currently selected file, and, until you again reorder the list, is the initial target of all 
  914. Look up, Template, and Contents requests, and the only file used by Show 
  915. Keys and Search.   The Help window opens, displaying the contents list of the selected 
  916. file.  
  917.  
  918. Set 411 Files…
  919.  
  920. This menu item presents a standard file dialog from which to locate a help folder.  If a help 
  921. folder is selected then all the files in the folder that end in the word help are placed in the 
  922. list of files to search (in Help_Files).  Note that this will remove any existing files from 
  923. the list..
  924.  
  925.  
  926. Edit 411 Files
  927.  
  928. This menu item open the Help_Files window, which contains a list of all the help files 
  929. that “411” knows about.  The list may be edited and then saved.  Note that each line 
  930. specifies a path to a single help file.
  931.  
  932.  
  933. About 411…
  934.  
  935. This menu item displays the credits and then does a lookup in the MPWHelp file for the 
  936. key “About 411”.
  937.  
  938.  
  939. Customizing “411”
  940.  
  941. There are several ways in which “411” can be customized by modifying the 
  942. UserStartup•Help script:
  943.  
  944. •   If you are using a file server and want the script to call the MPW Choose tool to mount 
  945.     the file server when MPW is launched, set the script variables Help_Server and 
  946.     Guest. Set the former to the desired zone:server:volume pathname, and set the 
  947.     latter to 1 if want to log onto the server as an AppleShare “guest.”.  Note:  This requires 
  948.     the Choose tool from MPW 3.2 or later.
  949.  
  950. •   If you wish to add or change command keys in the menu, simply edit the AddMenu 
  951.     commands in the UserStartup•Help script. For example, the line
  952.  
  953.     AddMenu 411 "Look up/1" 
  954.  
  955.     in the script could be changed to:
  956.  
  957.     AddMenu 411 "Look up/7" 
  958.  
  959.     to change the function key to Command-7.  Alternatively,
  960.  
  961.     AddMenu 411 "Look up" 
  962.     removes the function key associated with the Look up menu item entirely.
  963.  
  964. •   If you wish to change the name of the “411” menu, modify the argument of the AddMenu 
  965.     command.  For example, you can change the menu name “411” to “MyMenu” by 
  966.     changing all occurrences of AddMenu 411... to AddMenu MyMenu... in the 
  967.     UserStartup•Help script.
  968.  
  969. •   If you wish all help files to be listed in the header, change the script so that it sets the 
  970.     value of the variable headerStyle to -h (the default is -h2).
  971.  
  972.  
  973. Using the Get Tool
  974.  
  975. The retrieval of information through the “411” Help menu is based upon calls to the MPW 
  976. Get tool.  The calls that are used by “411” can be seen in the file UserStartup•Help.  If 
  977. you choose, you may instead call the Get tool directly or from your own script.  
  978.  
  979. (See the section on Get in the MPW 3.2 B1 Tools/Scripts Release Notes.)  
  980.  
  981.  
  982. Adding your own help to “411”
  983.  
  984. Help files used by the Get tool are ordinary MPW Shell document files whose names end 
  985. with “Help” and that have an internal organization which is recognized by the Get tool.  
  986. The requirements are that a Help file consists of a set of records, each record in turn con-
  987. sisting of one or more fields.  Each record must start with the field tag æKY (“æ” is option-')  
  988. followed by one or more words separated by carriage returns.  The search of the help file is 
  989. made on the key words.  All other fields are various categories of information to be re-
  990. trieved.  Field tags must be the first item on a line, and are separated from the following 
  991. material by one or more spaces.  Field tags are case sensitive.  Each field is terminated by 
  992. the appearance of a new field tag.  The record is terminated by the next æKY tag (or end of 
  993. file).
  994.  
  995. Example:
  996.  
  997.  
  998.  æKY Key1
  999.      Key2
  1000.      Key3
  1001.  æC This is a comment
  1002.  
  1003. The various tags other than æKY are used to put the information to be retrieved into cate-
  1004. gories.  The most neutral of them is æC, which is used for general textual matter.  These 
  1005. tags in some cases modify the behavior of Get.  For example, the tag æDT, which is used 
  1006. for templates, precedes data which will be retrieved if and only if Get is called with the -t 
  1007. option.  This is used in the implementation of the “template” menu item.  Other tags cause 
  1008. some boiler plate to be emitted prior to the text in the data base.  For example, the tag æRI is 
  1009. used for fields that contain chapter and page references to Inside Macintosh.  The text 
  1010. following the field tag will have inserted before it the cosmetic text:  “InsideMacintosh 
  1011. Reference:”.  
  1012.  
  1013. Field Tag Codes:
  1014.  
  1015.  æKY     Key word or set of key words separated by carriage returns.  This field denotes
  1016.          the beginning of  a “411” record and the words in this field are the record's
  1017.          names, i.e. the words used as keys for retrieval of the record’s data.
  1018.  
  1019.  æKL     Key word List .  This is typically used in conjunction with the key “Help” to
  1020.          list, as a table of contents, all of the key words in the file.
  1021.  
  1022.  æFa     File name of Assembler include file.
  1023.  
  1024.  æFc     File name of C header file.
  1025.  
  1026.  æFp     File name of Pascal Interface file.
  1027.  
  1028.  æF      Used for the names of files which are not interfaces.
  1029.  
  1030.  æT      Type of the item:  function/structure/constant/etc. 
  1031.  
  1032.  æD      Formal declaration of the item: function, procedure, or structure. 
  1033.  
  1034.  æDT     A template for calls of procedures and functions.
  1035.  
  1036.  æC      Commentary.  This is general textual information, generally lengthy compared
  1037.         to that associated with the other tags.
  1038.  
  1039.  æR      Reference to…  Used for references other than to Tech Notes and Inside
  1040.         Macintosh.
  1041.  
  1042.  æRI     Reference to Inside Macintosh.  This is usually a chapter and page reference.
  1043.  
  1044.  æRT     Reference to Tech Note.  This is usually a reference by number.
  1045.  
  1046.  æTN     Trap Number.  This is used to annotate function that are in-line trap calls.
  1047.  
  1048.  æMM     Routine may move or purge memory.  This tag cause issuance of the preceding
  1049.         warning.
  1050.  
  1051.  
  1052. When the Get tool is executed, it first retrieves the byte offset of a key word from the index 
  1053. file, positions to the æKY line in the help file, and then reads all of the following lines until 
  1054. another æKY typed line is encountered.  Get then outputs the record, after first removing 
  1055. the field tag codes from each field.  Therefore, if the contents of a help file are altered in 
  1056. any way, it is necessary that the index be rebuilt.  This is handled automatically by the Get 
  1057. tool, which puts up a dialog stating that the index needs to be rebuilt and requesting 
  1058. permission.  In ordinary circumstances, this dialog should be answered affirmatively.
  1059.  
  1060.  
  1061. About the files in your “411” folder
  1062.  
  1063. The "411" folder contains the following files:
  1064. :411:
  1065.        Install411                   # the "411 installation script.
  1066.        CIncludesHelp                # the CIncludesHelp data file. 
  1067.        CIncludesHelp.index          # the CIncludesHelp index file. 
  1068.        InsideMacintoshHelp          # Vols. 1-5 data file.
  1069.        InsideMacintoshHelp.index    # Vols. 1-5 index file.
  1070.        MPWHelp                      # the MPWHelp data file.
  1071.        MPWHelp.index                # the MPWHelp index file.
  1072.        PInterfacesHelp                # the PInterfacesHelp data file.
  1073.        PInterfacesHelp.index        # the PInterfacesHelp index file.
  1074.        ResourcesHelp                # the ResourcesHelp data file.
  1075.        ResourcesHelp.index          # the ResourcesHelp index file.
  1076.        TechNotesHelp                # the TechNotesHelp data file.
  1077.        TechNotesHelp.index          # the TechNotesHelp index file.
  1078.                           
  1079.  
  1080. :411:Tools:
  1081.        Get                          # the Get MPW tool - used to
  1082.                                     # look up help info.
  1083.        UserStartup•Help             # the "411" UserStartup script.
  1084.  
  1085.  
  1086. Files created by “411”
  1087.  
  1088. The following files are created by the UserStartup•Help script, either at startup time, or 
  1089. as the result of execution of menu items created by the script.  They all reside in the folder 
  1090. "{MPW}Help Folder:"
  1091.  
  1092.  
  1093.  
  1094.          Help                      # your "411" Help window.
  1095.          Help_Folder               # contains the "411" path name 
  1096.                                    # (path name to help data and 
  1097.                                    # index files) 
  1098.          Help_Files                # contains the list of all help  
  1099.                                    # files (full file names including path)
  1100.          Help_Temp                # temporary file used by the "411" menu
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107. æKY AddMenu
  1108. æC                      AddMenu -- add a menu item
  1109.  
  1110. AddMenu [menu [item [command…]]]  > menuList
  1111.  
  1112. Status codes returned:
  1113.   0    No errors.
  1114.   1    Syntax error.
  1115.   2    An item can’t be redefined.
  1116.   3    System error.
  1117.  
  1118.                            Description
  1119.  
  1120.   Associates a list of commands with the menu item itemName in the
  1121.   menu menuName. If the menu menuName already exists, the new item
  1122.   is appended to the bottom of that menu. If the menu menuName doesn’t
  1123.   already exist, a new menu is appended to the menu bar, and the new
  1124.   item is appended to that menu. When the new menu item is selected,
  1125.   its associated command list is executed just as though the command
  1126.   text had been selected and executed in the active window.
  1127.  
  1128.     • Note: The command text that you specify for an AddMenu item
  1129.     is processed twice—once when you execute the AddMenu command
  1130.     itself, and again whenever you subsequently select the new menu
  1131.     item. This means that you must be careful to quote items so that
  1132.     they are processed at the proper time. See the “Examples” section
  1133.     below.
  1134.  
  1135.   You can also use AddMenu to display information for existing user-defined
  1136.   menus by omitting parameters:
  1137.  
  1138.     • If command is not specified, the command list associated with
  1139.     itemName is written to standard output.
  1140.  
  1141.     • If itemName and command are both omitted, a list of all user-defined
  1142.     items for menuName is written to standard output.
  1143.  
  1144.     • If no parameters are specified, a list of all user-defined
  1145.     items is written to standard output.
  1146.  
  1147.   (This output is in the form of AddMenu commands.)
  1148.  
  1149.   You can also use AddMenu to change the command list or markings associated
  1150.   with a particular itemName. If both menuName and itemName already
  1151.   exist, the command list associated with itemName will be changed
  1152.   to command. Also, any marking or styles associated with itemName
  1153.   will be changed. The position of itemName in menuName will not be
  1154.   affected.
  1155.  
  1156.   You can define keyboard equivalents, character styles, and other
  1157.   features for your new menu commands—itemName can contain any of the
  1158.   metacharacters that are used with the AppendMenu( ) procedure documented
  1159.   in the MPW chapter entitled “Menu Manager” of Inside Macintosh:
  1160.  
  1161.   /char        Assign the keyboard equivalent Command-char.
  1162.  
  1163.   !char        Place char to the left of the menu item.
  1164.  
  1165.   ^n           Item has an icon, where n is the icon number. See Inside 
  1166.                Macintosh.
  1167.  
  1168.   (            Item is disabled (dimmed).
  1169.  
  1170.   <style       Item has a special character style; this style can be any
  1171.                of the following capital letters:
  1172.  
  1173.                B Bold
  1174.  
  1175.                I Italic
  1176.  
  1177.                U Underline
  1178.  
  1179.                O Outline
  1180.  
  1181.                S Shadow
  1182.  
  1183.   Multiple styles may be specified by preceding each with “<”. Be sure
  1184.   to quote menu items containing these special characters. (See the
  1185.   “Examples” section below.)
  1186.  
  1187.     • Note: Semicolons ( ; ) cannot be used within an itemName.
  1188.  
  1189.   Menu items can’t be appended to the Window, Mark, or Apple menus.
  1190.  
  1191.  
  1192.                             Examples
  1193.  
  1194.   AddMenu
  1195.  
  1196.   Lists all user-defined menu items.
  1197.  
  1198.   AddMenu Extras “TimeStamp//P” 'Echo `Date`'
  1199.  
  1200.   Adds an “Extras” menu with a “TimeStamp” item, which writes the current
  1201.   time and date to the active window. This item has the Command-key
  1202.   equivalent Command-P.
  1203.  
  1204.   AddMenu File 'Format<B' 'Erase 1'
  1205.  
  1206.   Adds a “Format” item to the File menu (as discussed under the Erase
  1207.   command) and makes the item bold.
  1208.  
  1209.   AddMenu Find Top 'Find • “{Active}”'
  1210.  
  1211.   Adds the menu item “Top” to the Find menu, and defines it as the
  1212.   Find command enclosed in single quotation marks. This command places
  1213.   the insertion point at the beginning of the active window.
  1214.  
  1215.   Note: The following attempt to do the same thing will not work:
  1216.  
  1217.   AddMenu Find Top “Find • {Active}”
  1218.  
  1219.   This command won’t work because the {Active} variable will be expanded
  1220.   when the menu is added. (It should be expanded when the menu item
  1221.   is executed.) In the first (correct) example, the single quotes defeat
  1222.   variable expansion when the AddMenu command is executed; they are
  1223.   then stripped before the item is actually added. The double quotation
  1224.   marks remain, in case the pathname of the active window happens to
  1225.   contain any special characters.
  1226.  
  1227.   You may want to add some or all of the following commands to your
  1228.   UserStartup file:
  1229.  
  1230.   AddMenu Find '(-' ''
  1231.  
  1232.   AddMenu Find 'Top/6' 'Find • “{Active}”'
  1233.  
  1234.   AddMenu Find 'Bottom/5' 'Find ∞ “{Active}”'
  1235.  
  1236.   These commands create several new items in the Find menu. The first
  1237.   is a disabled separator that creates a new section at the bottom
  1238.   of the menu. The Top and Bottom items position the insertion point
  1239.   at the top and bottom of the active window. Both menu items have
  1240.   Command-key equivalents.
  1241.  
  1242.   AddMenu Directory 'Work' 'Directory HD:MPW:Work'
  1243.  
  1244.   AddMenu Directory 'Work!•' 'Directory HD:MPW:Work'
  1245.  
  1246.   The first command creates a command to move to the directory HD:MPW:Work.
  1247.   The second command marks the Work item with a bullet without changing
  1248.   the position of the item in the menu.
  1249.  
  1250.                             See also 
  1251.  
  1252.    DeleteMenu command.
  1253.  
  1254.   “Quoting Special Characters,” “How Commands Are Interpreted,” and
  1255.   “Defining Your Own Menu Commands” in Chapter 5.
  1256.  
  1257.   “Creating a Menu in Your Program” in chapter “Menu Manager” of Inside
  1258.   Macintosh.
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264. æKY Adjust
  1265. æC                        Adjust -- adjust lines
  1266.  
  1267. Adjust [-c count] [-l spaces] selection [window]
  1268.  
  1269.  -c count                # repeat the Adjust count times
  1270.  -l spaces               # shift lines by “spaces” spaces
  1271.  
  1272. Status codes returned:
  1273.   0    At least one instance of the selection was found.
  1274.   1    Syntax error.
  1275.   2    Another error.
  1276.  
  1277.                            Description
  1278.  
  1279.   Finds and selects the given selection and shifts all lines within
  1280.   the selection to the right by one tab, without changing the indentation.
  1281.  
  1282.   If a count is specified, count instances of selection are affected.
  1283.   The -l option lets you move lines by any number of spaces to the
  1284.   left or right.
  1285.  
  1286.   If you specify the window parameter, the command operates on window.
  1287.   It’s an error to specify a window that doesn’t exist. If no window
  1288.   is specified, the command operates on the target window (the second
  1289.   window from the front).
  1290.  
  1291.  
  1292.                             Examples
  1293.  
  1294.   Adjust -l 4 §
  1295.  
  1296.   Shifts the lines containing the target selection to the right by
  1297.   four spaces.
  1298.  
  1299.   Adjust -l -8 /if/Δ:Δ/else/
  1300.  
  1301.   Selects everything after the next “if” and before the following “else”,
  1302.   and shifts all lines within the selection to the left by eight spaces.
  1303.  
  1304.                             See also 
  1305.  
  1306.   Align command.
  1307.   “Selections” in Chapter 6.
  1308.  
  1309. æKY Alert
  1310. æC                     Alert -- display an alert box
  1311.  
  1312. Alert [-s] [message…] < file
  1313.  -s                      # silent, don't beep when dialog is displayed
  1314.  
  1315. Status codes returned:
  1316.   0    No errors.
  1317.   1    Syntax error.
  1318.  
  1319.                            Description
  1320.  
  1321.   Displays an alert box containing the prompt message. The alert is
  1322.   displayed until its OK button is clicked. If the message contains
  1323.   any special characters, you’ll need to quote it.
  1324.  
  1325.  
  1326.                             Examples
  1327.  
  1328.   Alert Please insert next disk to be searched.
  1329.  
  1330.   Displays the following alert box and waits for the user to click
  1331.   “OK” before returning.
  1332.  
  1333.                             Also see
  1334.  
  1335.  Confirm and Request commands.
  1336. æKY Alias
  1337. æC               Alias  -- define or write command aliases
  1338.  
  1339. Alias [name [word…]]  > aliasList
  1340.  
  1341. Status codes returned:
  1342.   0    No errors.
  1343.   1    The specified alias could not be found.
  1344.  
  1345.                            Description
  1346.  
  1347.   Name becomes an alias for the list of words. Subsequently, when name
  1348.   is used as a command name, word… will be substituted in its place.
  1349.  
  1350.   If only name is specified, any alias definition associated with name
  1351.   is written to standard output. If name and word are both omitted,
  1352.   a list of all aliases and their values is written to standard output.
  1353.   (This output is in the form of Alias commands.)
  1354.  
  1355.   Aliases are local to the script in which they are defined. An initial
  1356.   list of aliases is inherited from the enclosing script. Inherited
  1357.   aliases may be overridden locally. You can make an alias definition
  1358.   available to all scripts by placing the definition in the UserStartup
  1359.   file.
  1360.  
  1361.   You can remove aliases with the Unalias command.
  1362.  
  1363.  
  1364.                              Examples
  1365.  
  1366.   Alias Dir Directory
  1367.  
  1368.   Creates an alias “Dir” for the Directory command.
  1369.  
  1370.   Alias Top 'Find •'
  1371.  
  1372.   Creates an alias “Top” for the command “Find •” (which places the
  1373.   insertion point at the beginning of a window). The command takes
  1374.   an optional window parameter and by default acts on the target window.
  1375.   The Top command could now be used as follows:
  1376.  
  1377.   Top # find top of target window
  1378.  
  1379.   Top Sample.a # find top of window Sample.a
  1380.  
  1381.   # (equivalent to “Find • Sample.a”)
  1382.  
  1383.                             See also
  1384.  
  1385.   Unalias command.
  1386.   “Command Aliases” in Chapter 5.
  1387.  
  1388. æKY Align
  1389. æC                 Align -- align text to left margin
  1390.  
  1391. Align [-c count] selection [window]
  1392.  -c count                # repeat the Align count times
  1393.  
  1394. Status codes returned:
  1395.   0    At least one instance of the selection was found.
  1396.   1    Syntax error.
  1397.   2    Any other error.
  1398.  
  1399.                            Description
  1400.  
  1401.   All lines within each instance of the selection are positioned to
  1402.   the same distance from the left margin as the first line in the selection.
  1403.  
  1404.   If you specify the window parameter, the Align command will act on
  1405.   window. It’s an error to specify a window that doesn’t exist. If
  1406.   no window is specified, the command operates on the target window
  1407.   (the second window from the front).
  1408.  
  1409.  
  1410.                              Examples
  1411.  
  1412.   Align §
  1413.  
  1414.   Same as the Align menu item; that is, it aligns all lines in the
  1415.   default selection with the first line of the selection.
  1416.  
  1417.   Align /Begin/:/End/
  1418.  
  1419.   Selects everything from the next “Begin” through the following “End”,
  1420.   and aligns all lines within the selection to the same margin position
  1421.   as the line that contains the “Begin”.
  1422.  
  1423.                              See Also
  1424.  
  1425.  Adjust command.
  1426.   “Selections” in Chapter 6.
  1427.  
  1428. æKY Asm
  1429. æC                    Asm -- MC68xxx Macro Assembler
  1430.  
  1431. Asm [option…] [file…]  < file > listing ≥ progress
  1432.  -addrsize size          # set size of address display
  1433.  -blksize blocks         # use blocks * 512 byte I/O buffers
  1434.  -case on                # distinguish between upper and lower case
  1435.  -case obj[ect]          # preserve case in object file
  1436.  -case off               # ignore case (default)
  1437.  -c[heck]                # syntax check only, don't create object file
  1438.  -d[efine] name          # equivalent to: name EQU 1
  1439.  -d[efine] name=value    # equivalent to: name EQU value
  1440.  -d[efine] &name         # equivalent to: &name SET[AC] 1
  1441.  -d[efine] &name=value   # equivalent to: &name SET[AC] value
  1442.  -e[rrlog] file          # write errors and warnings to file
  1443.  -f                      # suppress page ejects in listing
  1444.  -font name[,size]       # set listing font and size
  1445.  -h                      # suppress page headers in listing
  1446.  -i directory,…          # search for includes in directory,…
  1447.  -l                      # write full listing to output
  1448.  -lo file                # listing output file or directory
  1449.  -model far              # allow generation of load-time relocatable 32-bit references    
  1450.  -model near             # prohibit generation of load-time relocatable 32-bit
  1451.                          #       references (the default)
  1452.  -o objname              # generate code in file or directory objname
  1453.  -pagesize l[,w]         # set listing page length and width
  1454.  -print mode             # equivalent to: PRINT mode
  1455.  -p                      # write progress information to diagnostics
  1456.  -s                      # write short listing to output
  1457.  -sym off                # no SADE records
  1458.  -sym on|full            # full SADE records; can modify with [,nolines] 
  1459.                          # [,notypes] [,novars]
  1460.  -t                      # write time and total lines to diagnostics
  1461.  -w                      # suppress warnings
  1462.  -wb                     # suppress warnings on branch instructions
  1463.  
  1464. Status codes returned:
  1465.   0    No errors detected in any of the files assembled.
  1466.   1    Parameter or option errors.
  1467.   2    Errors detected.
  1468.  
  1469.                            Description
  1470.  
  1471.   Assembles the specified assembly-language source files. One or more
  1472.   filenames may be specified. If no filenames are specified, standard
  1473.   input is assembled and the file “a.o” is created. By convention,
  1474.   assembly-language source filenames end in the suffix “.a”. Each file
  1475.   is assembled separately—assembling file name.a creates object file
  1476.   name.a.o. The object filename can be changed with the -o option.
  1477.  
  1478.   See the MPW 3.0 Assembler Reference for more information about the
  1479.   assembly language. The first Commando dialog box for this command
  1480.   is reproduced here for convenience.
  1481.  
  1482.  
  1483.                              Examples
  1484.  
  1485.   Asm -w -l Sample.a Memory.a -d Debug
  1486.  
  1487.   Assembles Sample.a and Memory.a, producing object files Sample.a.o
  1488.   and Memory.a.o. Suppresses warnings and defines the name Debug as
  1489.   having the value 1. Two listing files are generated: Sample.a.lst
  1490.   and Memory.a.lst. (Sample.a and Memory.a are located in the AExamples
  1491.   directory.)
  1492.  
  1493.                             See Also
  1494.  
  1495.   MPW3.0 Assembler Reference.
  1496.  
  1497. æKY AsmCvtIIGS   
  1498. æC    AsmCvtIIGS -- converts APW Assembler source files to AsmIIGS format
  1499. AsmCvtIIGS [option…] <file> >listing ≥ progress
  1500.  -o <filename>           # write converted source to <filename>
  1501.  -p                      # write progress to diagnostic output
  1502.  -qe                     # add an "end" statement to the converted source
  1503.  -qr                     # make data and privdata segments records, rather than procs
  1504.  -w                      # warning messages are not displayed
  1505.  -i <filename>           # get definitions from the "include" file <filename>
  1506. æKY AsmIIGS
  1507. æC                   AsmIIGS -- the MPW IIGS Assembler
  1508. AsmIIGS [option…] [file…]  < file > listing ≥ progress
  1509.  -blksize blocks         # use blocks * 512 byte I/O buffers
  1510.  -case on                # distinguish between upper and lower case
  1511.  -case obj[ect]          # preserve case in object file
  1512.  -case off               # ignore case (default)
  1513.  -c[heck]                # syntax check only, don't create object file
  1514.  -d[efine] name          # equivalent to: name EQU 1
  1515.  -d[efine] name=value    # equivalent to: name EQU value
  1516.  -d[efine] &name         # equivalent to: &name SET[AC] 1
  1517.  -d[efine] &name=value   # equivalent to: &name SET[AC] value
  1518.  -f                      # suppress page ejects in listing
  1519.  -font name[,size]       # set listing font and size
  1520.  -h                      # suppress page headers in listing
  1521.  -i directory,…          # search for includes in directory,…
  1522.  -l                      # write full listing to output
  1523.  -lo file                # listing output file or directory
  1524.  -m                      # provide more target address information (l is also required)
  1525.  -o objname              # generate code in file or directory objname
  1526.  -pagesize l[,w]         # set listing page length and width
  1527.  -print mode             # equivalent to: PRINT mode
  1528.  -p                      # write progress information to diagnostics
  1529.  -s                      # write short listing to output
  1530.  -t                      # write time and total lines to diagnostics
  1531.  -w                      # suppress warnings
  1532. æKY AsmMatIIGS
  1533. æC                AsmMatIIGS -- Assembler source formatter
  1534. AsmMatIIGS [options...] SourceFile DestFile 
  1535.  -p               # write version information to diagnostic output
  1536.  -1 val           # column number that should contain the opcode (default 21)
  1537.  -2 val           # column number that should contain the operand (default 25)
  1538.  -3 val           # column number that should contain the comment (default 41)
  1539.  -t val           # number of spaces between tabs (default 20)
  1540.  -c val           # start column num for comments without semi-colons(default 35)
  1541. æKY Backup
  1542. æC                     Backup -- folder file backup
  1543.  
  1544. Backup [option…] -from folder -to folder [file…]  > commands ≥ progress
  1545.  -a                      # copy all files in "from" not in "to"
  1546.  -alt                    # alternate prompts for disk drives
  1547.  -c                      # create "to" folders if they don't exist
  1548.  -check checkopt,…       # produce reports based on checkopt
  1549.                          # checkopt=from     "from" not in "to"
  1550.                          #          to       "to" not in "from"
  1551.                          #          allfroms "from" not in "to" even if none
  1552.                          #          alltos   "to" not in "from" even if none
  1553.                          #          folders  "from" folders not in "to"
  1554.                          #          newer    "to"s newer than "from"s
  1555.  -co filename            # redirect -check reports to filename
  1556.  -compare [only][,'opts']# write compare commands for out-of-date files
  1557.  -d                      # write delete commands for files in "to" not in "from"
  1558.  -do [only][,'command']  # write the command string specified by command…
  1559.  -e                      # eject disk when done
  1560.  -from folder|drive      # specify source folder or drive (1 or 2)
  1561.  -l                      # write directory listing of "from" files
  1562.  -lastcmd 'command'      # write the command string as the last command
  1563.  -level n                # restrict -a and -d to files beyond level n
  1564.  -m                      # multi-disk -- more than one "from" or "to" disk
  1565.  -n                      # show folder nesting by indenting commands 
  1566.  -p                      # write progress information to diagnostics
  1567.  -r                      # recursively process nested folders
  1568.  -revert                 # revert "to" files to their "from" state
  1569.  -since date[,time]|fname# process only files since specified time
  1570.  -sync                   # synchronize both source and destination folders
  1571.  -t type                 # process only files of specified type
  1572.  -to folder|drive        # specify destination folder or drive (1 or 2)
  1573.  -y                      # suppress duplicate -y option
  1574.  
  1575. Status codes returned:
  1576.   0    No errors; Shell duplicate commands have been generated or filenames were     listed.
  1577.   1    Parameter or option errors.
  1578.   3    No errors and no files to duplicate or list.
  1579.   Note:  Backup returns a status code of 3 when no files need copying. 
  1580.        If no files are copied because none of the files in the source folder 
  1581.        exists in the destination folder, Backup also reports a warning to 
  1582.        the diagnostic output file. If there are no name matches, it is 
  1583.        possible that your from/to pathnames were specified incorrectly. 
  1584.        Hence, Backup lets you know of the possible error. Backup does not 
  1585.        report this as an error if you use the  -l, -a, or -since option.
  1586.  
  1587.                            Description
  1588.  
  1589.   Files in a source (“from”) folder are copied to a destination (“to”)
  1590.   folder based on the modification date. By default, only files that
  1591.   already exist in both the source and destination folders are candidates
  1592.   for copying. (The -a option can override this default.) Backup does
  1593.   not actually make the copies. Instead, it generates a script of MPW
  1594.   Shell duplicate commands.
  1595.  
  1596.   Backup’s default operation is based on the premise that you already
  1597.   have an existing folder on two sets of disks (generally a hard disk
  1598.   and a set of 3.5-inch disks—drive numbers may be specified as folder
  1599.   “names”) and that you want to make sure that the files on one of
  1600.   the disks are the same as the files on the other disk. Thus, it is
  1601.   the files on the destination (“to”) disk that determine which files
  1602.   can be copied from the source (“from”) disk.
  1603.  
  1604.   A Shell duplicate command is generated to the standard output file
  1605.   if
  1606.  
  1607.     • a file on a source disk also exists on the destination disk,
  1608.     and
  1609.  
  1610.     • the modification date of the source is newer than that of the
  1611.     destination.
  1612.  
  1613.   In addition to the basic function of generating Shell duplicate commands,
  1614.   Backup also provides these services:
  1615.  
  1616.     • Folders can be recursively processed, allowing processing of
  1617.     all folders and subfolders contained within folders (-r).
  1618.  
  1619.     • Compare commands can be generated for out-of-date files of
  1620.     type TEXT to discover why the files are different (-compare).
  1621.  
  1622.     • Filenames that exist on one disk and not on the other can be
  1623.     displayed
  1624.  
  1625.   (-check from,to).
  1626.  
  1627.     • File folder names that don’t exist on the destination can be
  1628.     displayed
  1629.  
  1630.   (-check folders).
  1631.  
  1632.     • Filenames in the destination that are newer than the source
  1633.     can be displayed
  1634.  
  1635.   (-check newer).
  1636.  
  1637.  
  1638.                              Examples
  1639.  
  1640.   backup  -from :HDfolder:  -e
  1641.  
  1642.   Check that all files on the disk in drive 1 (-to is omitted, so “-to
  1643.   1” is implied) are up to date with respect to the files in :HDfolder:.
  1644.   If they are, the disk in drive 1 is ejected. If not, the appropriate
  1645.   Duplicate commands are generated to update the out-of-date files
  1646.   on the disk in drive 1. An Eject 1 command is generated to eject
  1647.   the disk after the Duplicate commands are processed.
  1648.  
  1649.   backup  -r  -from FServer:MPW:  -to HD:MPW:  -check folders
  1650.  
  1651.   Recursively process (-r) all the files in all the folders on FServer:MPW:
  1652.   to make sure that the files on HD:MPW: are up-to-date. Appropriate
  1653.   Duplicate commands are generated to copy the out-of-date files from
  1654.   the folders in FServer:MPW: to the folders in HD:MPW:. It is assumed
  1655.   that the folder names in HD:MPW: are the same as the folder names
  1656.   in FServer:MPW:. Any folders in FServer:MPW: that don’t exist in
  1657.   HD:MPW are skipped. Because the -check option is specified, a list
  1658.   of all the skipped folders is written to the diagnostic file.
  1659.  
  1660.   Limitations Multi-disk operation (-m) is not supported with recursion
  1661.   (-r).
  1662.  
  1663.   The -e option is ignored when -m is specified.
  1664.  
  1665.   Only drive numbers 1 and 2 are supported, and they are assumed to
  1666.   be ejectable 3.5-inch disk drives.
  1667.  
  1668. æKY Beep
  1669. æC                       Beep -- generate tones
  1670.  
  1671. Beep [note [,duration [,level]]]…
  1672.  #   duration is given in sixtieths of a second (default is 15)
  1673.  #   sound level is given as a number from 0 to 255 (default is 128)
  1674.  
  1675. Status code returned:
  1676.    0    no errors.
  1677.  
  1678.  
  1679.                            Description
  1680.  
  1681.   For each parameter, Beep produces the given note for the specified
  1682.   duration and sound level on the Macintosh speaker. If no parameters
  1683.   are given, a simple beep is produced.
  1684.  
  1685.   Note is one of the following:
  1686.  
  1687.     • A number indicating the count field for the square wave generator,
  1688.     as described in chapter “Summary of the Sound Driver” of Inside
  1689.     Macintosh.
  1690.  
  1691.     • A string in the following format:
  1692.  
  1693.   [ n ] letter [ # | b ]
  1694.  
  1695.   n is an optional number between –3 and 3 indicating the octaves below
  1696.   or above middle C, followed by a letter indicating the note (A–G)
  1697.   and an optional sharp (#) or flat (b) sign. Note that any sharps
  1698.   (#) must be enclosed in quotation marks—otherwise they will be interpreted
  1699.   as comment delimiters.
  1700.  
  1701.   The optional duration is given in sixtieths of a second. The default
  1702.   duration is 15 (one-quarter second).
  1703.  
  1704.   The optional sound level is given as a number from 0 to 255. The
  1705.   default level is 128.
  1706.  
  1707.  
  1708.                              Examples
  1709.  
  1710.   Beep
  1711.  
  1712.   Produce a simple beep on the speaker.
  1713.  
  1714.   Beep 2C,20 '2C#,40' 2D,60
  1715.  
  1716.   Play the three notes specified: C , C sharp, and D—all two octaves
  1717.   above middle C—for one-third, two-thirds, and one full second, respectively.
  1718.   Notice that the second parameter must be quoted; otherwise the sharp
  1719.   character (#) would indicate a comment.
  1720.  
  1721. æKY Begin
  1722. æC                      Begin  -- group commands
  1723.  
  1724. Begin
  1725.  command…
  1726. End
  1727.  
  1728. The status code of the last command executed is returned. 
  1729. (If no commands appear between Begin and End, 0 is returned.)
  1730.  
  1731.                            Description
  1732.  
  1733.   Groups commands for pipe specifications, conditional execution, and
  1734.   input/output specifications. Carriage returns must appear at the
  1735.   end of each line as shown above, or be replaced with semicolons (
  1736.   ; ). If the pipe symbol (|), conditional execution operators (&&
  1737.   and ||), or input/output specifications (<, >, >>, ≥, ≥≥, ∑, ∑∑)
  1738.   are used, the operator must appear after the End command and applies
  1739.   to all of the enclosed commands.
  1740.  
  1741.     • Note: Begin and End behave like left and right parentheses.
  1742.     Once the Begin command has been executed, the Shell will not
  1743.     execute any of the subsequent commands until it encounters the
  1744.     End command, so that input/output specifications can be processed.
  1745.  
  1746.  
  1747.                              Examples
  1748.  
  1749.   The following commands save the current variables, exports, aliases,
  1750.   and menus in the file SavedState.
  1751.  
  1752.   Begin
  1753.     Set
  1754.     Export
  1755.     Alias
  1756.     AddMenu
  1757.   End > SavedState
  1758.  
  1759.   Notice that the output specification following “End” applies to all
  1760.   of the commands within the Begin…End control command. This command
  1761.   is identical to the following:
  1762.  
  1763.   (Set; Export; Alias; AddMenu) > SavedState
  1764.  
  1765.   The commands Set, Export, Alias, and AddMenu write their output in
  1766.   the form of commands; these commands can be executed to redefine
  1767.   variables, exports, aliases, and menus, respectively. Therefore,
  1768.   after executing the above commands, the command
  1769.  
  1770.   Execute SavedState
  1771.  
  1772.   will restore all of these definitions. You must “execute” the script
  1773.   so that the variables and aliases are applied to the current scope.
  1774.  
  1775.     • Note: This technique is used in the Suspend script to save
  1776.     state information. (You might want to take a look at Suspend,
  1777.     which also saves the list of open windows and the current directory.)
  1778.     The Resume file runs the file that Suspend creates, restoring
  1779.     the various definitions, reopening the windows, and resetting
  1780.     the current directory.
  1781.  
  1782. æKY Break
  1783. æC                   Break -- break from For or Loop
  1784.  
  1785. Break [If expression]
  1786.  
  1787. Status codes returned:
  1788.   0    No errors detected.
  1789.   –3   Break is found outside a For…End or Loop…End, or the parameters
  1790.        to Break are incorrect.
  1791.   –5   Invalid expression.
  1792.  
  1793.                            Description
  1794.  
  1795.   If expression is nonzero, Break terminates execution of the immediately
  1796.   enclosing For or Loop command. (Null strings are considered zero.)
  1797.   If the “If expression” is omitted, the break is unconditional. (For
  1798.   a definition of expression, see the Evaluate command.)
  1799.  
  1800.  
  1801.                              Examples
  1802.  
  1803.   Set Exit 0
  1804.   For file in Startup UserStartup Suspend Resume Quit
  1805.     EnTab “{file}” > temp
  1806.     Break If {Status} != 0
  1807.     Rename -y temp “{file}”
  1808.     Print -h “{file}”
  1809.     Echo “{file}”
  1810.   End
  1811.  
  1812.   This For loop entabs and prints each of the special MPW scripts;
  1813.   the Break command terminates the loop if a nonzero status value is
  1814.   returned. (See the For command for further explanation of this example.)
  1815.  
  1816.   Set loopcount |
  1817.     Loop
  1818.     Break if {loopcount} > 10
  1819.     Echo “Loop Number {loopcount}”
  1820.     Evaluate loopcount +=1
  1821.   End
  1822.  
  1823.   This example loops until the variable {loopcount} is greater than
  1824.   10. Use of the Evaluate command is also demonstrated.
  1825.  
  1826.  
  1827.                              See also 
  1828.  
  1829.   For, Loop, and If commands.
  1830.  
  1831.   Evaluate command (for a description of expressions).
  1832.  
  1833.   “Structured Commands” in Chapter 5.
  1834.  
  1835. æKY Browser
  1836. æC                Browser -- invoke Marker Browser
  1837.  
  1838.                   # The MPW Browser command is used to navigate source files or other text.  It 
  1839.                   # presents a window containing a list of the files in the current directory
  1840.                   # and, for the selected file, a list of markers.  Double-clicking on the marker
  1841.                   # opens the file with the selection point at the marker.  Entering a marker name
  1842.                   # in a text box searches all files in the directory for that marker, and if found 
  1843.                   # opens the file with the selection point at the marker.
  1844.  
  1845. æKY BuildCommands
  1846. æC                BuildCommands -- show build commands
  1847.  
  1848. BuildCommands program [option…] > commands
  1849.  option…                 # Make command options
  1850.  
  1851. Status code 0 is returned if the build commands are generated 
  1852. without error.  If an error occurs, the status code returned by Make is returned.
  1853.  
  1854.                            Description
  1855.  
  1856.   BuildCommands writes to standard output the commands needed to build
  1857.   the specified program.
  1858.  
  1859.   Make is used to generate the build commands. If file program.make
  1860.   exists, it is used as the makefile. If not, file MakeFile is used.
  1861.  
  1862.   The specified options control the generation of the build commands.
  1863.   The options are passed directly to Make. BuildCommands is used to
  1864.   implement the Show Build Commands and Show Full Build Commands menu
  1865.   items in the Build Menu.
  1866.  
  1867.  
  1868.                              Examples
  1869.  
  1870.   Open {Worksheet}
  1871.  
  1872.   BuildCommands Count >> {Worksheet} ≥≥ Dev:StdOut
  1873.  
  1874.   Generates the build commands for Count. The Worksheet window is brought
  1875.   to the front. The build commands, or any errors generated by Make
  1876.   are written at the end of the Worksheet. The Show BuildCommands menu
  1877.   item is implemented using similar commands.
  1878.  
  1879.  
  1880.                              See also 
  1881.  
  1882.   “Building a Program:  An Introduction” in Chapter 2
  1883.  
  1884.         
  1885. æKY BuildMenu
  1886. æC                  BuildMenu -- create the Build menu
  1887.  
  1888. Status codes returned:
  1889.  0    is always returned.
  1890.  
  1891.                            Description
  1892.  
  1893.   Creates the Build menu shown below. Each of the items in the menu
  1894.   is described in Chapter 3 of the MPW Manual.
  1895.  
  1896.  
  1897.                              Examples
  1898.  
  1899.   BuildMenu
  1900.  
  1901.   Creates the Build menu. This command should appear in the UserStartup
  1902.   file to create the Build menu.
  1903.  
  1904.  
  1905.                              See also 
  1906.  
  1907.   "Building a Program: An Introduction" in Chapter 2.
  1908.  
  1909. æKY BuildMenuIIGS
  1910. æC        BuildMenuIIGS -- adds CreateMakeIIGS to the Build menu
  1911. BuildMenuIIGS
  1912. æKY BuildProgram
  1913. æC             BuildProgram -- build the specified program
  1914.  
  1915. Status code 0 is returned if the build is completed without error. 
  1916. If an error occurs during the generation of the build commands, the status 
  1917. value returned by Make is returned. If an error occurs during the build, the 
  1918. Status value returned by the build step that detected the error (such as Asm 
  1919. or Link) is returned.
  1920.  
  1921. BuildProgram program [option…] > log
  1922.  option…                 # Make command options
  1923.  
  1924.                            Description
  1925.  
  1926.   Builds the specified program. A simple transcript of the build, including
  1927.   timing information and commands used to do the build, is written
  1928.   to standard output.
  1929.  
  1930.   Make is used to determine the commands needed to do the build. If
  1931.   file
  1932.  
  1933.   program.make exists, it is used as the makefile. If not, the file
  1934.   MakeFile is used.
  1935.  
  1936.   The options specified are passed directly to Make; they control the
  1937.   generation of the build commands. BuildProgram is used to implement
  1938.   the Build and Full Build menu items in the Build menu.
  1939.  
  1940.  
  1941.                              Examples
  1942.  
  1943.   Open {Worksheet}
  1944.  
  1945.   BuildProgram -e Count >> {Worksheet} ≥≥ Dev:StdOut
  1946.  
  1947.   Completely rebuilds Count. The Worksheet window is brought to the
  1948.   front. The transcript of the build and any errors are written at
  1949.   the end of the Worksheet. The Full Build menu command is implemented
  1950.   using similiar commands.
  1951.  
  1952.  
  1953.                              See also 
  1954.  
  1955.   "Building a Program:  An Introduction" in Chapter 2
  1956.  
  1957. æKY C
  1958. æC                            C -- C compiler
  1959.  
  1960. C [option…] [file] < file > preprocessor ≥ progress
  1961.     -b                     # put string constants into code and generate PC-relative references
  1962.     -b2                    # implies '-b' above, and allows string constants to be overlaid
  1963.     -b3                    # overlaid string constants in code (but not PC-relative refs.)
  1964.     -c                     # syntax check only, don't create object file
  1965.     -d name                # equivalent to: #define name 1
  1966.     -d name=string         # equivalent to: #define name string
  1967.     -e                     # write preprocessor results to output
  1968.     -e2                    # implies '-e' above, and strips comments
  1969.     -elems881              # generate MC68881 code for transcendentals
  1970.     -i directory           # search for includes in directory
  1971.     -m                     # generate 32-bit references for data (less efficient code)
  1972.     -mbg ch8               # v2.0 compatible macsbug symbols
  1973.     -mbg off               # no macsbug symbols in the code (link/unlk only if necessary)
  1974.     -mbg on|full           # full macsbug symbols
  1975.     -mbg <n>               # macsbug symbols to length <n> (<n> can be 0..255)
  1976.     -mc68020               # generate MC68020 code 
  1977.     -mc68881               # generate MC68881 code for arithmetic operations
  1978.     -n                     # Turn pointer assignment incompatibilty errors into warnings
  1979.     -o objname             # generate code in file or directory objname
  1980.     -p                     # write progress information to diagnostic
  1981.     -r                     # warn on calling a function that has no definition
  1982.     -s segment             # generate code in segment
  1983.     -sym off               # no SADE records
  1984.     -sym on|full           # full SADE records; can modify with [,nolines] [,notypes] [,novars]
  1985.     -t                     # write compilation time to diagnostic
  1986.     -u name                # equivalent to: #undef name
  1987.     -w                     # suppress warnings
  1988.     -w2                    # emit even more warnings
  1989.     -y directory           # create temporary files in directory
  1990.  
  1991. Status codes returned:
  1992.   0    Successful completion.
  1993.   1    Errors occurred.
  1994.  
  1995.                            Description
  1996.  
  1997.   Compiles the specified C source file. Compiling file Name.c creates
  1998.   object file Name.c.o. (By convention, C source filenames end in a
  1999.   “.c” suffix.) If no filenames are specified, standard input is compiled
  2000.   and the object file “c.o” is created.
  2001.  
  2002.   (Note that SADE object file information cannot be generated for standard
  2003.   input source files.)
  2004.  
  2005.   See the MPW 3.0 C Reference Manual for details of the C language
  2006.   definition.
  2007.  
  2008.                              Examples
  2009.  
  2010.   C -p Sample.c
  2011.  
  2012.   Compiles Sample.c, producing the object file Sample.c.o. Writes progress
  2013.   information to diagnostic output. (Sample.c is found in Examples:CExamples.)
  2014.  
  2015.  
  2016.                              See also 
  2017.  
  2018.   MPW3.0C Reference.
  2019.  
  2020.  
  2021. æKY Canon
  2022. æC                   Canon -- canonical spelling tool
  2023.  
  2024. Canon [option…] dictionary [file…]   < file > new
  2025.  -s                      # case sensitive replacement
  2026.  -a                      # assembler identifiers (include $, %, @)
  2027.  -c n                    # consider only the first n characters
  2028.  
  2029. Status codes returned:
  2030.   0    All files processed successfully.
  2031.   1    Error in command line.
  2032.   2    Other errors.
  2033.  
  2034.                            Description
  2035.  
  2036.   Canon copies the specified files to standard output, replacing identifiers
  2037.   with the canonical spellings given in dictionaryFile. If no files
  2038.   are specified, standard input is processed.
  2039.  
  2040.   DictionaryFile is a text file that specifies the identifiers to be
  2041.   replaced and their new (or canonical) spellings. Identifiers are
  2042.   defined as a letter followed by any number of letters or digits.
  2043.   (The underscore character ( _ ) is also considered a letter.) Each
  2044.   line in the dictionary contains either a pair of identifiers or a
  2045.   single identifier:
  2046.  
  2047.     • If two identifiers appear, the first is the identifier to replace,
  2048.     and the second is its canonical spelling. For example, the dictionary
  2049.     entry
  2050.  
  2051.     NIL NULL # change NIL to NULL
  2052.  
  2053.     changes each occurrence of “NIL” to “NULL”.
  2054.  
  2055.     • A single identifier specifies both the identifier to match
  2056.     and its canonical spelling. This feature is useful because the
  2057.     matching may not be case sensitive or restricted to a fixed number
  2058.     of characters. (See the “Options” section on the next page.)
  2059.     For example, the dictionary entry
  2060.  
  2061.     true
  2062.  
  2063.     changes all occurrences of “TRUE”, “True”, “tRUE”, and so on to “true”.
  2064.  
  2065.   You can specify a left context for the first identifier on each line
  2066.   of the dictionary by preceding it with a sequence of nonidentifier
  2067.   characters. Replacement will then occur only if the left context
  2068.   in the input file exactly matches the left context in the dictionary.
  2069.   For example, if C structure component upperLeft should be replaced
  2070.   with topLeft, the dictionary might include the following:
  2071.  
  2072.   .upperLeft topLeft
  2073.   ->upperLeft topLeft
  2074.  
  2075.   You can include comments in the dictionary file by using the # symbol:
  2076.   everything from the # to the end of the line is ignored.
  2077.  
  2078.     • Note: The file Canon.Dict is a sample dictionary file that’s
  2079.     included with MPW. (See the “Examples” section below.)
  2080.  
  2081.  
  2082.                              Examples
  2083.  
  2084.   The file Canon.Dict, in the Tools folder, contains a list of all
  2085.   of the identifiers used in the Standard C library and the Inside
  2086.   Macintosh C interfaces. This list was made from the Library Index
  2087.   in the MPW 2.0 C Reference. The entries in Canon.Dict look like the
  2088.   following:
  2089.  
  2090.   abbrevDate
  2091.   ABCallType
  2092.   abortErr
  2093.   ABProtoType
  2094.   abs
  2095.   acos
  2096.   activateEvt
  2097.   …
  2098.  
  2099.   The following command copies the file Source.c to the file Temp;
  2100.   identifiers whose first eight characters match a dictionary entry
  2101.   are replaced with that entry.
  2102.  
  2103.   Canon -c 8 {MPW}Tools:Canon.Dict Source.c > Temp
  2104.  
  2105.   The -c 8 option is useful when porting source code from other systems
  2106.   where only eight characters are significant.
  2107.  
  2108.     • Note: The list of Pascal identifiers used in the Inside Macintosh
  2109.     interface is almost identical to the list used in C. The dictionary
  2110.     Canon.Dict can also be used to port Pascal programs from other
  2111.     systems, as long as you use the canonical capitalizations for
  2112.     the various Standard C library identifiers.
  2113.  
  2114.   Limitations The maximum line length in the dictionary file is 256
  2115.   characters. Longer lines are considered an error. Identifiers and
  2116.   words in comment sections are replaced.
  2117.  
  2118. æKY Catenate
  2119. æC                    Catenate -- concatenate files
  2120.  
  2121. Catenate [file…]  < file > catenation
  2122.  
  2123. Status codes returned:
  2124.   0    All files were processed successfully.
  2125.   1    One or more files were not found.
  2126.   2    An error occurred in reading or writing.
  2127.  
  2128.                            Description
  2129.  
  2130.   Catenate reads the data fork of each file in sequence and writes
  2131.   it to standard output. If no input file is given, Catenate reads
  2132.   from standard input. None of the input files may be the same as the
  2133.   output file.
  2134.  
  2135.  
  2136.                              Examples
  2137.  
  2138.   Catenate Makefile.a
  2139.  
  2140.   Writes Makefile.a to the active window immediately following the
  2141.   command.
  2142.  
  2143.   Catenate File1 File2 > CombinedFile
  2144.  
  2145.   Concatenates the first two files and places the result in the third.
  2146.   If CombinedFile doesn’t exist, it will be created; if it exists,
  2147.   it will be overwritten.
  2148.  
  2149.   Set selection “`Catenate §`”
  2150.  
  2151.   Captures the selection from the target window in the Shell variable
  2152.   {selection}.
  2153.  
  2154.   Catenate >> {Worksheet}
  2155.  
  2156.   Appends all subsequently entered text to the Worksheet window (until
  2157.   you indicate end-of-file by pressing Command-Enter).
  2158.  
  2159.   Warning Beware of commands such as
  2160.  
  2161.   Catenate File1 File2 > File1
  2162.  
  2163.   The above command will cause the original data in File1 to be lost.
  2164.   To append one file to another, use the form
  2165.  
  2166.   Catenate File2 >> File1
  2167.  
  2168.  
  2169.                              See also 
  2170.  
  2171.   Duplicate command.
  2172.  
  2173.   “Redirecting Input and Output” in Chapter 5.
  2174.  
  2175. æKY CFront
  2176. æC                     CFront -- C++ to C translator
  2177.  
  2178. CFront [option…] [file…] < file > intermediate output ≥ progress
  2179.     -a                      # force ANSI-style intermediate C code (default)
  2180.     -a0                     # force K&R-style (pre-ANSI) intermediate C code
  2181.     -a1                     # force ANSI-style intermediate C code (default)
  2182.     -c                      # intermediate code to standard output; no object file
  2183.     -d name                 # equivalent to: #define name 1
  2184.     -d name=string          # equivalent to: #define name string
  2185.     -e                      # write preprocessor results to output
  2186.     -e2                     # implies '-e' above, and strips comments
  2187.     -elems881               # generate MC68881 code for transcendentals
  2188.     -f filename             # act as if input comes from named file when it actually is from stdin 
  2189.     -f1                     # send text version of C code to C compiler (no token stream)
  2190.     -i directory            # search for includes in directory
  2191.     -mc68020                # generate MC68020 code 
  2192.     -mc68881                # generate MC68881 code for arithmetic operations
  2193.     -mtbl0                  # suppress output of method tables for Object Pascal Classes
  2194.     -mtbl1                  # force output of method tables for Object Pascal Classes
  2195.     -n                      # Turn pointer assignment incompatibilty errors into warnings
  2196.     -p                      # write progress information to diagnostic
  2197.     -s segment              # generate code in segment
  2198.     -u name                 # equivalent to: #undef name
  2199.     -vtbl0                  # suppress output of virtual tables for ordinary class
  2200.     -vtbl1                  # force output of virtual tables for ordinary class
  2201.     -vtbl2                  # new improved output algorithm for virtual tables
  2202.     -w                      # suppress warnings
  2203.     -w1                     # generate additional warnings from CFront
  2204.     -w3                     # passed through to C compiler (supresses unused warnings)
  2205.     -y directory            # create temporary files in directory
  2206.     -z0                     # force 'inline' functions to be non-inline
  2207.     -z3                     # supress name encoding of local vars and struct members (default)
  2208.     -z4                     # encode names of local vars and struct members
  2209.     -z6                     # force enums always to be int variables
  2210.     -z7                     # relax requirement on static class member initialization 
  2211.  
  2212. æKY CheckIn
  2213. æC                CheckIn -- check a file into a project
  2214.  
  2215. CheckIn -w | -close | ([options…] files…) > progress
  2216.  -a                 # checkin all files in current directory
  2217.  -b                 # check in files… as branches
  2218.  -c                 # cancel if conflict occurs (avoids dialog)
  2219.  -cf file           # the comment is contained in file.
  2220.  -close             # close the Check In window
  2221.  -cs comment        # a description of changes made to the file
  2222.  -delete            # delete the file after checking it in
  2223.  -m                 # check out the files for modification after checking in
  2224.  -n                 # answer no to all dialogs (avoids dialogs)
  2225.  -new               # add a new file to the project
  2226.  -p                 # write progress information to standard output
  2227.  -project project   # name of project that contains the files
  2228.  -t task            # a short description of task accomplished
  2229.  -touch             # touch the mod date of file after checking in
  2230.  -u user            # name of current user
  2231.  -w                 # open the Check In window
  2232.  -y                 # answer yes to all dialogs (avoids dialogs)
  2233.  
  2234. Status codes returned:
  2235.   0    No errors.
  2236.   1    Syntax error.
  2237.   2    Error in processing.
  2238.   3    System error.
  2239.  
  2240.                            Description
  2241.  
  2242.   Return ownership of the specified files to Projector and save all
  2243.   changes as new revisions. The default is to leave you with a read-only
  2244.   copy of the file.
  2245.  
  2246.   File must be an HFS pathname. Projector determines the project each
  2247.   file belongs to by inspecting the file's resource fork. Since Projector
  2248.   puts the name of the project in the resource fork of checked-out
  2249.   files, files belonging to different projects can be checked in with
  2250.   a single command.
  2251.  
  2252.   If the -a (all) option is used instead of file..., Projector examines
  2253.   all files in the current directory and checks in all files in the
  2254.   current directory that have been checked out for modification. The
  2255.   files are checked into their respective projects.
  2256.  
  2257.   To add a new file to the project, use the -new option.
  2258.  
  2259.   When the file is checked in, Projector automatically increments the
  2260.   revision number by one. For example, if revision 2.17 was checked
  2261.   out, the new revision will be 2.18. To override this, use the ProjectInfo
  2262.   command to find the revision number, increase it by the amount desired,
  2263.   and then check the file in, using the “filename,rev” notation. For
  2264.   example, if file.c revision 2.17 was checked out, you could check
  2265.   it in as file.c,3.0 to jump to the next major revision level.
  2266.  
  2267.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  2268.   symbols used in Projector commands.
  2269.  
  2270.  
  2271.                              Examples
  2272.  
  2273.   CheckIn file.c -cs “added some comments”
  2274.  
  2275.   Check in file.c to the current project. A new revision of file.c
  2276.   is created and the user is left with a read-only copy of the file.
  2277.   The comment is saved with the new revision. Because no revision number
  2278.   is specified, Projector simply increases the revision number by one.
  2279.  
  2280.   CheckIn file.c interface.c,5 -t “Added -x option”
  2281.  
  2282.   -cf commentFile
  2283.  
  2284.   This command checks in two files reading the comment from the file
  2285.   commentFile. The task is also saved with the new revisions. The user
  2286.   is left with read-only copies of the files. The new revision for
  2287.   interface.c is revision 5.
  2288.  
  2289.   CheckIn hd:work:file.c hd:work:main.c -m
  2290.  
  2291.   The files to be checked in are hd:work:file.c and :main.c. After
  2292.   the command executes, the user still has modifiable copies of the
  2293.   files.
  2294.  
  2295.   CheckIn -new file.c
  2296.  
  2297.   To check a new file into the project use the -new option. The above
  2298.   command adds file.c to the current project.
  2299.  
  2300.   CheckOut -project Zoom∫Utilities∫MyProject file.c -m
  2301.  
  2302.   ...edit the file...
  2303.  
  2304.   CheckIn -project Zoom∫Utilities∫MyProject file.c -b
  2305.  
  2306.   The preceding command sequence illustrates the usefulness of the
  2307.   -b option. In this case, the user checked out a write-privileged
  2308.   copy of the latest revision of file.c from the current project, edited
  2309.   the file, and then, using the branch option, checked in the file
  2310.   on a branch.
  2311.  
  2312.  
  2313.                              See also 
  2314.  
  2315.   CheckOut and CheckOutDir.
  2316.  
  2317. æKY CheckOut
  2318. æC              CheckOut -- check a file out from a project
  2319.  
  2320. CheckOut -w | -close | ([options…] files…) > progress
  2321.  -a                    # check out all the files in the current project
  2322.  -b                    # checkout specified files on a new branch
  2323.  -c                    # cancel if conflict occurs (avoids dialog)
  2324.  -cancel               # cancel the checkout of the files
  2325.  -cf file              # the comment is contained in files
  2326.  -close                # close the Check Out window
  2327.  -cs comment           # a short description of changes
  2328.  -d dir                # directory where the checked out files should go
  2329.  -m                    # check out a modifiable copy of the file
  2330.  -n                    # answer no to all dialogs (avoids dialogs)
  2331.  -newer                # checkout latest copy of all files in the project
  2332.  -noTouch              # don't touch the mod date of the checked out files
  2333.  -open                 # open the files after checking out
  2334.  -p                    # write progress information to standard output
  2335.  -project project      # name of project that contains the files
  2336.  -r                    # recursively checkout files
  2337.  -t task               # a short description of task accomplished
  2338.  -u user               # name of current user
  2339.  -update               # checkout latest copy of all files you already have
  2340.  -w                    # open the Check Out window
  2341.  -y                    # answer yes to all dialogs (avoids dialogs)
  2342.  
  2343. Status codes returned:
  2344.   0    No errors.
  2345.   1    Syntax error.
  2346.   2    Error in processing.
  2347.   3    System error.
  2348.  
  2349.                            Description
  2350.  
  2351.   Under Projector, CheckOut obtains copies of file revisions from a
  2352.   project. The default is to check out read-only copies. Unless otherwise
  2353.   specified, copies are placed in the checkout directory associated
  2354.   with the project.
  2355.  
  2356.   If file is a leafname (that is, file.c), Projector checks out the
  2357.   latest revision of the file from the current project. If file specifies
  2358.   a revision (for example, file.c,22), that revision is checked out.
  2359.  
  2360.   If file is a partial or full HFS pathname (that is, :work:file.c
  2361.   or HD:work:file.c), the file does not go into the checkout directory.
  2362.   Instead, Projector checks out the file (that is, file.c) in the current
  2363.   project and places the copy in the specified HFS location (that is,
  2364.   in the :work: or HD:work: directory, respectively).
  2365.  
  2366.   Finally, file may be a Name. See the NameRevisions command for more
  2367.   information about Names. The Name is expanded and the corresponding
  2368.   revisions are checked out.
  2369.  
  2370.   To check out an old revision for modification, you must specify the
  2371.   -b (branch) option.
  2372.  
  2373.   If you are checking out revision 5 of file.c into hd:work and Projector
  2374.   determines that you already have that revision in the work directory,
  2375.   Projector will not recopy the data of revision 5. This is especially
  2376.   nice when you are checking out a revision for modification, and you
  2377.   already have a read-only copy of that revision.
  2378.  
  2379.   See Chapter 7 of MPW manual for complete definitions of the terms and
  2380.   symbols used in Projector commands.
  2381.  
  2382.  
  2383.                              Examples
  2384.  
  2385.   CheckOut -m -project Zoom∫Utilities∫MyProject file.c
  2386.  
  2387.   Checks out a write-privileged copy of the latest revision of file.c
  2388.   from the Zoom∫Utilities∫MyProject project. The file is placed in
  2389.   the checkout directory for the project.
  2390.  
  2391.   CheckOut -m file.c
  2392.  
  2393.   The above command checks out the latest revision of file.c for modification.
  2394.   The file is placed in the checkout directory for the project. If
  2395.   you already happen to have the latest revision of file.c in the checkout
  2396.   directory, then Projector only updates the 'ckid' resource of file.c
  2397.   to indicate that it is now a modifiable file.
  2398.  
  2399.   CheckOut -project Zoom∫Utilities∫Kerfroodi file.c,22
  2400.  
  2401.   The above command checks out a read-only copy of revision 22 of file.c
  2402.   from the Zoom∫Utilities∫Kerfroodi project. The file is placed in
  2403.   the checkout directory for the project.
  2404.  
  2405.   Project Zoom∫Utilities∫Kerfroodi
  2406.  
  2407.   CheckOut file.c -t “Fix Bug 7” -m -d “{Zoom}UtilitiesSrc:Kerfroodi”
  2408.  
  2409.   By setting the current project with the Project command you don’t
  2410.   need to specify a project on subsequent Projector commands. By setting
  2411.   the task other users will be able to see why you have checked out
  2412.   file.c. The files are placed in {Zoom}UtilitiesSrc:Kerfroodi.
  2413.  
  2414.   CheckOut -a -d HD:Work:Test
  2415.  
  2416.   The above example checks out read-only copies of all of the files
  2417.   in the current project and places the copies in the directory HD:work:Test.
  2418.  
  2419.   CheckOut -a -project Zoom∫ -r
  2420.  
  2421.   Checks out read-only copies of all files in the Zoom project and
  2422.   all of its subprojects. Its behavior is the same as if you had executed
  2423.   these commands individually:
  2424.  
  2425.   CheckOut -a -project Zoom∫
  2426.  
  2427.   CheckOut -a -project Zoom∫Voom
  2428.  
  2429.   CheckOut -a -project Zoom∫Utilities
  2430.  
  2431.   CheckOut -a -project Zoom∫Utilities∫MyProject
  2432.  
  2433.   ...
  2434.  
  2435.   You can conveniently update the read-only files (from the current
  2436.   project) in the current directory without affecting any files checked
  2437.   out for modification. To do this, use the -update option:
  2438.  
  2439.   CheckOut -update -d :
  2440.  
  2441.  
  2442.                              See also 
  2443.  
  2444.   CheckIn and CheckOutDir.
  2445.  
  2446. æKY CheckOutDir
  2447. æC  CheckOutDir -- specify the directory where checked out files will placed
  2448.  
  2449. CheckOutDir [-project project | -m] [-r] [-x | directory]
  2450.  -project project # name of project to associate with the checkout directory
  2451.  -m               # list the checkout directories of all root projects
  2452.  -r               # recursively set or display the checkout directories
  2453.  -x               # reset the checkout directories to ":"
  2454.  
  2455. Status codes returned:
  2456.   0    No errors.
  2457.   1    Syntax error.
  2458.   2    Error in processing.
  2459.   3    System error.
  2460.  
  2461.                            Description
  2462.  
  2463.   Under Projector, CheckOutDir changes the checkout directory associated
  2464.   with the current project to the HFS pathname directory. From this
  2465.   point on, files checked out of the named project are placed, by default,
  2466.   into this directory. The directory is created if it does not exist.
  2467.   When a project is mounted, the checkout directory is initially set
  2468.   to “:”—that is, the current directory.
  2469.  
  2470.   It is recommended that you put CheckOutDir commands immediately following
  2471.   the corresponding MountProject commands you place in your UserStartup
  2472.   file, script, or AddMenu for project initialization.
  2473.  
  2474.   If directory is missing, the checkout directory of the current project
  2475.   is written to standard output in the form of a CheckOutDir command.
  2476.  
  2477.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  2478.   symbols used in Projector commands.
  2479.  
  2480.  
  2481.                              Examples
  2482.  
  2483.   CheckOutDir HD:work:Test
  2484.  
  2485.   This command causes subsequent files in the current project to be
  2486.   checked out to the HD:work:Test folder.
  2487.  
  2488.   CheckOutDir
  2489.  
  2490.   CheckOutDir -project Zoom∫Utilities∫Test HD:work:Test
  2491.  
  2492.   The above command outputs the checkout directory of the current project
  2493.   in the form of a CheckOutDir command.
  2494.  
  2495.   CheckOutDir -project Zoom∫ -r
  2496.  
  2497.   CheckOutDir -project Zoom∫ :
  2498.  
  2499.   CheckOutDir -project Zoom∫Vroom :
  2500.  
  2501.   CheckOutDir -project Zoom∫Utilities :
  2502.  
  2503.   CheckOutDir -project Zoom∫Utilities∫Test HD:work:Test
  2504.  
  2505.   The -r option lets you display the checkout directory for the current
  2506.   project and all subprojects. In this case, only the sort project
  2507.   has a checkout directory setting that differs from the default.
  2508.  
  2509.   The -r option can also be used to set the checkout directories of
  2510.   a complex project to mirror the projects own hierarchical structure.
  2511.   For example:
  2512.  
  2513.   CheckOutDir -project Zoom∫ -r HD:Work:
  2514.  
  2515.   After executing the above command, listing the checkout directories
  2516.   for the projects under Zoom yields
  2517.  
  2518.   CheckOutDir -project Zoom∫ -r
  2519.  
  2520.   CheckOutDir -project Zoom∫ HD:work:
  2521.  
  2522.   CheckOutDir -project Zoom∫Vroom HD:Work:Vroom
  2523.  
  2524.   CheckOutDir -project Zoom∫Utilities HD:Work:Utilities
  2525.  
  2526.   CheckOutDir -project Zoom∫Utilities∫Test HD:Work:Utilities:Test
  2527.  
  2528.   Notice how the directory structure is similar to the project structure.
  2529.   The directories are created if they do not exist.
  2530.  
  2531.   The -m option lists the checkout directories of the root projects.
  2532.   For example
  2533.  
  2534.   CheckOutDir -m
  2535.  
  2536.   CheckOutDir -project Zoom∫ HD:Work:Zoom
  2537.  
  2538.   CheckOutDir -project Test∫ HD:Test
  2539.  
  2540.  
  2541.                              See also 
  2542.  
  2543.   MountProject, CheckIn, and CheckOut.
  2544.  
  2545. æKY CIIGS
  2546. æC                CIIGS -- the MPW IIGS C Compiler
  2547. CIIGS [option…] [file] < file > preprocessor ≥ progress
  2548.  -d name               # equivalent to: #define name 1
  2549.  -d name=string        # equivalent to: #define name string
  2550.  -i directory          # search for includes in directory
  2551.  -o objname            # generate code in file objname
  2552.  -p                    # write progress information to diagnostics
  2553.  -s segment            # name the default load segment
  2554.  -u name               # equivalent to: #undef name
  2555. æKY Choose
  2556. æC   Choose -- choose or list network file server volumes and printers
  2557.  
  2558. Choose [option…] [[zone]:server[:volume] …]
  2559.  -askpw                # ask for server password (in a "safe" dialog box)
  2560.  -askvp                # ask for volume password (in a "safe" dialog box)
  2561.  -c                    # output in the form of further "Choose" commands.
  2562.  -cp                   # print driver name and type of current printer.
  2563.  -dr driverFileName    # name of printer driver file in system folder 
  2564.                        # (e.g. "LaserWriter")
  2565.  -guest                # log-in to the file server as a guest.
  2566.  -list                 # list entities (don't choose them).
  2567.  -p                    # print version information.
  2568.  -pr                   # choose printers (instead of file servers).
  2569.  -pw password          # specify server log-in password.
  2570.  -u username           # specify user name for server log-in.
  2571.  -v                    # verbose (print names of volumes really mounted).
  2572.  -vp volumePassword    # specify volume password (to mount it).
  2573.  -type type            # specify type of entity to list or choose (or '≈').
  2574.  
  2575.  Names take the form     "zone:server:volume"
  2576.  
  2577.  The wildcard '≈' may be used in place of a zone, server, volume or
  2578.  type name.  A leading ':' (empty zone name) or '*:' indicates the
  2579.  current zone.  A name of the form "…server:" will mount all volumes
  2580.  on the server, unless a specific volume name is given.
  2581.  
  2582. Status codes returned:
  2583.   0    No errors.
  2584.   1    Syntax error on command line.
  2585.   3    Any other error.
  2586.  
  2587.                            Description
  2588.  
  2589.   Choose noninteractively mounts or lists the specified AppleShare
  2590.   volumes or printers. Each name takes the form
  2591.  
  2592.   [zone]:[server[:volume]]
  2593.  
  2594.   (“Server” means any file or printer server.) The zone name is always
  2595.   optional and defaults to the current zone. A server name must be
  2596.   preceded by (at least) a colon. Volume names are only applicable
  2597.   to file servers.
  2598.  
  2599.   When mounting file server volumes, a server name is required. If
  2600.   a volume name is specified, only that volume is mounted. If the volume
  2601.   name is omitted, or if it is the wildcard character “≈”, all volumes
  2602.   on the server are mounted:
  2603.  
  2604.   [zone]:server:volume
  2605.  
  2606.   [zone]:server[:≈]
  2607.  
  2608.   When -list is specified, the wildcard character “≈” may be used in
  2609.   place of names in all of the fields: “≈” in the zone field expands
  2610.   to all zones; “≈” in the server field expands to all servers in the
  2611.   specified zones; “≈” in the volume-name field expands to volumes
  2612.   on the specified servers (listing volumes on a server requires a
  2613.   server login—that is, as a user with a valid password or as a guest).
  2614.   If the wildcard character “≈” is used, it must be quoted so that
  2615.   the Shell will not expand it.
  2616.  
  2617.   The -list option also expands the next unspecified item in a name.
  2618.   A zone name followed by nothing else expands to a list of servers
  2619.   in that zone, and a server name followed by nothing else expands
  2620.   to a list of volumes on the server.
  2621.  
  2622.   If a “≈”, “:” or “” character appears in a server, volume, or zone
  2623.   name, it may be quoted with the character “”. This quoting mechanism
  2624.   supplements quoting already performed by the Shell.
  2625.  
  2626.   Any number of volumes may be mounted (though a system-dependent limit
  2627.   exists on the number of active server connections). Only one printer
  2628.   may be chosen at a time, since only one printer can be active.
  2629.  
  2630.   Server and volume passwords are case sensitive. More than one server
  2631.   and volume may be mounted with a single command, but the server and
  2632.   volume passwords must be the same for each, since at most one password
  2633.   of each type may be specified on the command line.
  2634.  
  2635.  
  2636.                              Examples
  2637.  
  2638.   Choose :Linker:Sources
  2639.  
  2640.   Mount the volume Sources on the server Linker, located in the current
  2641.   zone, using the default user name, server password, and volume password.
  2642.  
  2643.   Choose -v -guest 'Systems:Sources:Doc' 'Systems:Games:≈'
  2644.  
  2645.   Mount the volume Doc on the server Sources and every volume on the
  2646.   server Games in the zone Systems as a guest. Print the names of the
  2647.   volumes that are mounted by the command. List the names of all zones.
  2648.   Notice that the wildcard character “≈” is quoted.
  2649.  
  2650.   Choose -list 'Whale Zone:≈' 'Whale Zone:Moby Dick:≈' '≈:'
  2651.  
  2652.   List all file servers in the zone Whale Zone, all volumes on the
  2653.   file server Moby Dick in that zone (after logging in with the default
  2654.   user name and server password) and all zones (with their servers).
  2655.  
  2656.   Choose -pr -list ':≈'
  2657.  
  2658.   Choose -cp -pr Zarf:Kitchen Sink
  2659.  
  2660.   List all printers of the current type in the current zone. Print
  2661.   the name of the currently selected printer, then select the printer
  2662.   called Kitchen Sink in the zone Zarf.
  2663.  
  2664.   Choose -list -type Fortune Cookie Server '≈:≈'
  2665.  
  2666.   List all network entities of type Fortune Cookie Server in all zones.
  2667.  
  2668.  
  2669.                              See also 
  2670.  
  2671.   Unmount and Volumes commands.
  2672.  
  2673.  
  2674.  
  2675. æKY Clear
  2676. æC                     Clear -- clear the selection
  2677.  
  2678. Clear [-c count] selection [window]
  2679.  -c count                # repeat the Clear count times
  2680.  
  2681. Status codes returned:
  2682.   0    At least one instance of selection was found.
  2683.   1    Syntax error.
  2684.   2    Any other errors.
  2685.  
  2686.                            Description
  2687.  
  2688.   Finds selection and deletes its contents. The selection is not copied
  2689.   to the Clipboard. (For a definition of selection, see Chapter 6 of the
  2690.   MPW manual.)
  2691.  
  2692.   If window is specified, the Clear command acts on that window. It’s
  2693.   an error to specify a window that doesn’t exist. If no window is
  2694.   specified, the command operates on the target window (the second
  2695.   window from the front).
  2696.  
  2697.  
  2698.                              Examples
  2699.  
  2700.   Clear §
  2701.  
  2702.   Deletes the current selection. This is like the Clear command in
  2703.   the menu bar, except that the action occurs in the target window
  2704.   rather than the active window.
  2705.  
  2706.   Clear /BEGIN/:/END/
  2707.  
  2708.   Selects everything from the next BEGIN through the following END,
  2709.   and deletes the selection.
  2710.  
  2711.  
  2712.                              See also 
  2713.  
  2714.   Cut and Replace commands.
  2715.  
  2716.   “Selections” in Chapter 6 (see Appendix B for a summary).
  2717.  
  2718. æKY Close
  2719. æC                   Close -- close specified windows
  2720.  
  2721. Close [-y | -n | -c] [ -a | window…]
  2722.  -y                  # save modified windows before closing (avoids dialog)
  2723.  -n                  # don't save any modified windows (avoids dialog)
  2724.  -c                  # cancel if there is a modified window (avoids dialog)
  2725.  -a                  # close all the windows
  2726.  
  2727. Status codes returned:
  2728.   0    No errors.
  2729.   1    Syntax error 
  2730.   2    Any other error, such as “Window not found.”
  2731.   4    Cancelled from dialog.
  2732.  
  2733.                            Description
  2734.  
  2735.   Close the window or windows specified by window. If no window is
  2736.   specified, the target window is closed. If changes to the window
  2737.   have not been saved, a dialog box requests confirmation of the Close
  2738.   command. In scripts you can use the -y, -n, or -c option to avoid
  2739.   this interaction. Use the -a option instead of window to close all
  2740.   of the open windows (other than the Worksheet).
  2741.  
  2742.  
  2743.                              Examples
  2744.  
  2745.   Close
  2746.  
  2747.   Closes the target window, prompting the user with a confirmation
  2748.   dialog box if needed.
  2749.  
  2750.   Close -a -y
  2751.  
  2752.   Saves and closes all open windows.
  2753.  
  2754.   Close -n Test.a Test.r
  2755.  
  2756.   Closes the windows Test.a and Test.r without saving any of the changes.
  2757.  
  2758.  
  2759.                              See also 
  2760.  
  2761.   “File Menu” in Chapter 3.
  2762.         
  2763. æKY CMarker
  2764. æC          CMarker -- generate Mark commands for C and C++ function definitions
  2765.                      
  2766. CMarker [option…] [file…]
  2767.  -a[nachronisms]         # suppress anachronisms messages
  2768.  -d[efine] name[=string] # define name to the preprocessor (same as #define)
  2769.      [,name[=string]]… 
  2770.  -e                      # show macro expansion in the listing (default with -ppout)
  2771.  -ext[ensions] on|off    # turn on or off Apple compiler extensions (default on)
  2772.     -errors                 # suppress marking if errors are detected
  2773.  -i[ncludes] pathname    # search for include files in the specified directories (Max of 15)
  2774.      [,pathname],… 
  2775.  -lang[uage] C|"C++"     # specify target sources as either C or C++ (Default is C)
  2776.  -linesize n             # maximum number of characters generated in a single listing line
  2777.  -l[ist[ing]]            # generate a listing of the source to stdout
  2778.     -mc68881                # define the macro name mc68881 as having the value 1
  2779.  -msi                    # mark include (header) files
  2780.  -pp                                       # preprocessing only (no markers will be generated)
  2781.  -ppout filename         # write the preprocessor output to the specified filename
  2782.  -p[rogress]             # write version, progress and summary information to stderr
  2783.  -showskipped            # show lines skipped by conditional compilation in the listing output
  2784.  -t                      # display processing time and number of lines to stderr
  2785.  -u[ndefine] name        # undefine the preprocessor symbol name  (same as #undef)
  2786.     [,name]…
  2787.  
  2788. Status codes returned:
  2789.  0    No errors.
  2790.     1    Parameter or option error.
  2791.     2    Execution error.
  2792.     3    Syntax errors.
  2793.     
  2794.                            Description
  2795.  
  2796. CMarker reads the specified C++/ANSI C source file(s), syntax checks them and 
  2797. generates appropriate "Open" and "Mark" MPW commands, which, when executed, 
  2798. will mark the source file(s) at each function definition with the marker name being the 
  2799. name of the function.  It's purpose is to aid in the marking of source files for use with 
  2800. the MPW "marker browser" capability.  CMarker contains a full ANSI C preprocessor 
  2801. and provides options to mark include files, generate source listings (with or without 
  2802. showing macro expansions), run the preprocessor only, flag anachronisms, and syntax 
  2803. check C++/ANSI C with or without Apple extensions.  CMarker runs as an MPW Tool.    
  2804.  
  2805. æKY Commando
  2806. æC          Commando -- present a dialog interface for commands
  2807.  
  2808. Commando [command] [-modify]
  2809.     -modify                 # enable Commando’s built-in editor
  2810.  
  2811. Status codes returned:
  2812.   0    The Do It button was selected.
  2813.   1    The Cancel button was selected.
  2814.   2    Error occurred while parsing the cmdo resource.
  2815.   3    I/O or program error.
  2816.  
  2817.                            Description
  2818.  
  2819.   The Commando interface lets you operate any properly configured MPW
  2820.   tool or script using specialized Macintosh dialog boxes instead of
  2821.   the ordinary command line method. The dialogs make it easy to find
  2822.   options and build up complex command lines.
  2823.  
  2824.   Commands with many options and parameters may employ one or more
  2825.   nested dialog boxes. See “Commando Dialogs” in Chapter 4 of the MPW manual
  2826.   for more information on the basics of using the Commando dialogs. Chapter
  2827.   13 describes the structure of the Commando resource and shows how
  2828.   to create Commando dialogs for your own tools and scripts.
  2829.  
  2830.   The controls of a Commando dialog box, including text fields, buttons,
  2831.   titles, and so on, can be sized and moved within the dialog box by
  2832.   using the mouse, exactly as you would drag an object in the Finder.
  2833.   See “Editing Commando Dialogs” in Chapter 13 for information on moving
  2834.   and sizing controls.
  2835.  
  2836.  
  2837.                              Examples
  2838.  
  2839.   Commando Rez
  2840.  
  2841.   Displays the frontmost Rez dialog box shown under “Rez” in Part II.
  2842.  
  2843.   Rez…
  2844.  
  2845.   Displays the frontmost Rez dialog box shown under “Rez” in Part II,
  2846.   exactly as in the previous example.
  2847.  
  2848.  
  2849.                              See also 
  2850.  
  2851.   “Invoking Commando” in Chapter 4.
  2852.  
  2853.   Chapter 13.
  2854.  
  2855. æKY Compare
  2856. æC                    Compare -- compare text files
  2857.  
  2858. Compare [option…] file1 [file2]  < file2 > differences ≥ progress
  2859.  -b                      # treat several blanks or tabs as a single blank
  2860.  -c c1-c2[,c1-c2]        # compare only specified columns
  2861.  -d depth                # maximum stack depth
  2862.  -e context              # display specified number of context lines
  2863.  -g groupingFactor       # grouping factor (matching lines for resync)
  2864.  -h width                # write differences horizontally
  2865.  -l                      # lower case (i.e. ignore case differences)
  2866.  -m                      # suppress displays of mismatched lines 
  2867.     -n                      # don't write to output if files match
  2868.  -p                      # write progress information to diagnostics
  2869.  -s                      # use static grouping factor
  2870.  -t                      # ignore trailing blanks
  2871.  -v                      # suppress line numbers in vertical displays
  2872.  -x                      # don't expand tabs
  2873.  
  2874. Status codes returned:
  2875.   0    Files match.
  2876.   1    Parameter or option error.
  2877.   2    Files don’t match.
  2878.  
  2879.                            Description
  2880.  
  2881.   Compares the lines of two text files and writes their differences
  2882.   to standard output. Options are provided to compare a specific column
  2883.   range in each file
  2884.  
  2885.   (-c), to ignore blanks (-b), and to ignore case (-l).
  2886.  
  2887.   Both files are read and compared line for line. As soon as a mismatch
  2888.   is found, the two mismatched lines are stored in two stacks, one
  2889.   for each file. Lines are then read alternately (starting from the
  2890.   next input line in file2 ) until a match is found to put the files
  2891.   back in synchronization. If such a match is found, Compare writes
  2892.   the mismatched lines to standard output.
  2893.  
  2894.   Files are considered resynchronized when a certain number of lines
  2895.   in the two stacks exactly match. By default, the number of lines,
  2896.   called the grouping factor, is defined by the formula
  2897.  
  2898.   G = Trunc((2.0 * Log10(M)) + 2.0)
  2899.  
  2900.   where G is the grouping factor and M is the number of lines saved
  2901.   in each stack so far. This definition requires more lines to be the
  2902.   same after larger mismatches. Using this formula, the following table shows
  2903.   the grouping factor G as a function of the number of mismatched lines:
  2904.  
  2905.   M: Number of G: Grouping
  2906.  
  2907.   mismatched lines factor
  2908.  
  2909.   1 to 3 2
  2910.  
  2911.   4 to 9 3
  2912.  
  2913.   10 to 31 4
  2914.  
  2915.   32 to 99 5
  2916.  
  2917.   100 to 315 6
  2918.  
  2919.   316 to 999 7
  2920.  
  2921.   1000 to 3161 8
  2922.  
  2923.   3162 to 9999 9
  2924.  
  2925.   With the default dynamic grouping, the -g option sets the lower limit
  2926.   for G (which must be at least 2, because the formula is always applied).
  2927.   The -s option lets you fix G as a static constant. A static G may
  2928.   be desirable under some circumstances, but may also resynchronize
  2929.   the files at undesirable points, especially if G is too small. It’s
  2930.   recommended that you use the default (dynamic G ) first; if the results
  2931.   aren’t satisfactory, try a higher minimum value of dynamic G (such
  2932.   as 3 or 4). If that is still unsatisfactory, try the static G option.
  2933.  
  2934.   With either option, there’s a limit on the depth of the stacks— that
  2935.   is, on how far out of synchronization the two files can get before
  2936.   they’re no longer worth comparing. For a dynamic G, the limit on
  2937.   the number of mismatched lines is 1000, but you can choose a lower
  2938.   limit with the -d option. For the static G option, typical values
  2939.   for G are 1 to 5, and the stack depth should be between about 10
  2940.   and 50 (the default limit is 25).
  2941.  
  2942.  
  2943.                              Examples
  2944.  
  2945.   Compare File File.bak > Mismatches
  2946.  
  2947.   Compares File and File.bak, writing the results to the file Mismatches.
  2948.   No options are specified, so dynamic grouping is used, blanks are
  2949.   retained, tabs are expanded into spaces, and matching is case sensitive.
  2950.  
  2951.   Compare File.old.§ File.new.§
  2952.  
  2953.   Compares the selected portions of the two windows and writes out
  2954.   the results.
  2955.  
  2956.   Limitations Compare can handle text files with a maximum line length
  2957.   of 255 characters.
  2958.  
  2959.   The text files compared should be fewer than 9999 lines long, because
  2960.   the displays are formatted based on four-digit line numbers.
  2961.  
  2962.  
  2963.                              See also 
  2964.  
  2965.   Equal command (Equal is a quicker command that tells you whether
  2966.   files are different, but stops at the first byte at which they differ).
  2967.  
  2968. æKY CompareFiles
  2969. æC  CompareFiles -- compare text files and interactively view differences
  2970.  
  2971. CompareFiles [-9 | -13 | -b x y | -Portrait | -TwoPage] oldFile newFile
  2972.  -9                      # assume a screen size of 512 x 342
  2973.  -13                     # assume a screen size of 640 x 480
  2974.  -b x y                  # tile windows into the rectangle specified by x y
  2975.     -Portrait               # screen size for Apple Macintosh Portrait Display
  2976.     -TwoPage                # screen size for Apple Two-Page Monochrome Monitor
  2977.  
  2978. Status codes returned:
  2979.   0    The files match.
  2980.   1    Syntax error.
  2981.   2    The files differ.
  2982.  
  2983.                            Description
  2984.  
  2985.   CompareFiles compares two text files (using the tool Compare) and,
  2986.   if there are any differences, displays the file in adjacent windows
  2987.   for interactively viewing the differences. A menu will be appended
  2988.   to the menu bar to go through the changes.
  2989.  
  2990.   When all the changes have been shown, the windows will be closed
  2991.   (if they were closed when CompareFiles started) and the menu will
  2992.   be deleted.
  2993.  
  2994.   The Compare menu contains four items for viewing and editing the
  2995.   differences. The items perform the following actions:
  2996.  
  2997.   Find Next Change Finds the next difference and highlights the changes
  2998.   in each window. (Notice that the differences are shown from bottom
  2999.   to top. This is so editing changes will not affect the file offsets
  3000.   recorded from the Compare tool.)
  3001.  
  3002.   Copy Selection »» Replaces the changed text in the new file with
  3003.   the old text.
  3004.  
  3005.   Copy Selection «« Replaces the old text with the changed text from
  3006.   the new file.
  3007.  
  3008.   Done Closes the files (asking if you want to save changes) and deletes
  3009.   the Compare menu. Use this item to close all the windows and delete
  3010.   the menu. (If you close any of the windows yourself, they will not
  3011.   be restored to their previous size and position.)
  3012.  
  3013.   The figure below shows the CompareFiles menu.
  3014.  
  3015.  
  3016.  
  3017.  
  3018.                              Examples
  3019.  
  3020.   CompareFiles Sample.old Sample.c
  3021.  
  3022.   Compares the file Sample.c to Sample.old. If there are some differences,
  3023.   those two files are opened side by side on the screen.
  3024.  
  3025.   CompareFiles -b 1024 1024 Sample.old Sample.c
  3026.  
  3027.   Compares the file Sample.c to Sample.old. If there are differences,
  3028.   the files are opened and tiled into a 1024 by 1024 rectangle.
  3029.  
  3030.  
  3031.                              See also 
  3032.  
  3033.   Compare Tool.
  3034.  
  3035. æKY CompareRevisions
  3036. æC   CompareRevisions -- compare two revisions of a file in a project
  3037. CompareRevisions file…
  3038. \.
  3039. Status codes returned:
  3040.   0    No Errors.
  3041.   1    Syntax Error.
  3042.   2    Error in Processing.
  3043.   3    System Error.
  3044.  
  3045.                            Description
  3046.  
  3047.   Compare the revision of the HFS file file with another revision of
  3048.   that same file.
  3049.  
  3050.   CompareRevisions uses the ProjectInfo command to determine what project
  3051.   file belongs to and what its revision is. CompareRevisions then displays
  3052.   a list of the other revisions of the file for the user to choose.
  3053.   CompareRevisions checks this other revision out and calls the CompareFiles
  3054.   script to display both revisions on the screen and to highlight the
  3055.   differences between them. CompareFiles puts up an AddMenu named Compare
  3056.   to help you step through the differences between the two revisions.
  3057.  
  3058.   The file must belong to a currently mounted project. If the project
  3059.   that the file belongs to is not currently mounted, CompareRevisions
  3060.   displays an Alert.
  3061.  
  3062.   CompareRevisions uses the CompareFiles script.
  3063.  
  3064.  
  3065.                              Examples
  3066.  
  3067.   CompareRevisions file.c
  3068.  
  3069.   This example compares the revision in HFS file “file.c” in the working
  3070.   directory with any other revisions of file.c in the project.
  3071.  
  3072.   AddMenu Project 'Compare Revisions' 'CompareRevisions {Active} ∑∑ {WorkSheet}'
  3073.  
  3074.   This example adds CompareRevisions to the Project menu and allows
  3075.   you to compare revisions by opening the file you wish to compare
  3076.   and then selecting the 'Compare Revisions' menu item in the Project
  3077.   menu.
  3078.  
  3079.  
  3080.                              See also 
  3081.  
  3082.   CompareFiles.
  3083.  
  3084. æKY Confirm
  3085. æC             Confirm -- display a confirmation dialog box
  3086.  
  3087. Confirm [-t] [message…] < file
  3088.  -t                      # three buttons (Yes, No, Cancel)
  3089.  
  3090. Status codes returned:
  3091.   0    The OK button was selected.
  3092.   1    Syntax error.
  3093.   4    The Cancel button was selected or the No button was clicked in a three-way    dialog box.
  3094.   5    The Cancel button was selected in a three-way dialog box; see the -t option.
  3095.  
  3096.                            Description
  3097.  
  3098.   Confirm displays a confirmation dialog box with OK and Cancel buttons
  3099.   and the prompt message. There is no output to this command: the result
  3100.   of the dialog is returned in the {Status} variable.
  3101.  
  3102.   Note: Because Confirm returns a nonzero status value to indicate
  3103.   that No or Cancel was selected, a script should set the Shell variable
  3104.   {Exit} to zero before executing the Confirm command. (This step is
  3105.   necessary because the Shell aborts script processing when a nonzero
  3106.   status value is returned and {Exit} is nonzero.)
  3107.  
  3108.  
  3109.                              Examples
  3110.  
  3111.   Set Exit 0
  3112.   Confirm “Replace files with the same name? ”
  3113.   If {Status} == 0
  3114.     Duplicate -y Source:≈ Destination:
  3115.   End
  3116.   Set Exit 1
  3117.  
  3118.   The following confirmation dialog box will be displayed:
  3119.  
  3120. æKY Continue
  3121. æC        Continue -- continue with next iteration of For or Loop
  3122.  
  3123. Continue [If expression]
  3124. Status codes returned:
  3125.    0   No errors.
  3126.   –3   Error in parameters, or Continue not within For…End or Loop…End.
  3127.   –5   Invalid expression.
  3128.  
  3129.                            Description
  3130.  
  3131.   If expression is nonzero, Continue terminates this iteration of the
  3132.   immediately enclosing For or Loop command and continues with the
  3133.   next iteration. (Null strings evaluate to zero.) If the “If expression”
  3134.   clause is omitted, the Continue is unconditional. If no further iterations
  3135.   are possible, the For or Loop is terminated. (For a definition of
  3136.   expression, see the Evaluate command.)
  3137.  
  3138.  
  3139.                              Examples
  3140.  
  3141.   Set Exit 0
  3142.   Set list “”
  3143.   For file In `files -t TEXT`
  3144.     Confirm -t “Print file {file}?”
  3145.     Set SaveStatus {Status}
  3146.     Continue If {SaveStatus} == 4 # No
  3147.     Break If {SaveStatus} == 5 # Cancel
  3148.     Set list “{list} '{file}'” # YesEnd
  3149.   End
  3150.   Print {PrintOptions} {list}
  3151.   Set Exit 1
  3152.  
  3153.   In this example, the Continue command is executed if the user selects
  3154.   No (status value 4). The Continue causes the current file to be skipped, but
  3155.   processing continues with the next file in the list.
  3156.  
  3157.   (For a full explanation of this example, refer to the Confirm command.)
  3158.  
  3159.  
  3160.                              See also 
  3161.  
  3162.   For, Loop, Break, and If commands.
  3163.  
  3164.   Evaluate command, for a description of expressions.
  3165.  
  3166.   “Structured Commands” in Chapter 5.
  3167.  
  3168. æKY Copy
  3169. æC                  Copy -- copy selection to Clipboard
  3170.  
  3171. Copy [-c count] selection [window]
  3172.  -c count                # copy the nth selection, where n = count
  3173.  
  3174. Status codes returned:
  3175.   0    At least one instance of the selection was found.
  3176.   1    Syntax error.
  3177.   2    Any other error.
  3178.  
  3179.                            Description
  3180.  
  3181.   Finds selection in the specified window and copies it to the Clipboard,
  3182.   replacing the previous contents of the Clipboard. If no window is
  3183.   specified, the command operates on the target window (the second
  3184.   window from the front). It’s an error to specify a window that doesn’t
  3185.   exist.
  3186.  
  3187.   For a definition of selection, see “Selections” in Chapter 6 of the MPW
  3188.   manual; a summary
  3189.   of the selection syntax is contained in Appendix B.
  3190.  
  3191.     • Note: To copy files, use the Duplicate command.
  3192.  
  3193.  
  3194.                              Examples
  3195.  
  3196.   Copy §
  3197.  
  3198.   Copies the current selection to the Clipboard. This command is like
  3199.   the Copy command in the Edit menu, except that the action takes place
  3200.   in the target window.
  3201.  
  3202.   Copy /BEGIN/:/END/
  3203.  
  3204.   Selects everything from the next BEGIN through the following END
  3205.   and copies this selection to the Clipboard.
  3206.  
  3207.  
  3208.                              See also 
  3209.  
  3210.   Cut and Paste commands.
  3211.  
  3212.   “Selections” in Chapter 6 and Appendix B.
  3213.  
  3214.  
  3215. æKY Count
  3216. æC                  Count -- count lines and characters
  3217.  
  3218. Count [-l] [-c] [file…]  < file > counts
  3219.  -l                      # write only line counts
  3220.  -c                      # write only character counts
  3221.  
  3222. Status codes returned:
  3223.   0    No errors.
  3224.   1    Error in parameters.
  3225.   2    Unable to open input file.
  3226.  
  3227.                            Description
  3228.  
  3229.   Counts the lines and characters in its input and writes the results
  3230.   to standard output. If no files are specified, standard input is
  3231.   read. If more than one file is specified, separate counts are printed
  3232.   for each file, one per line and preceded by the filename. A total
  3233.   is printed following the list.
  3234.  
  3235.  
  3236.                              Examples
  3237.  
  3238.   Count MakeFile.c Count.c
  3239.  
  3240.   Displays line counts and character counts in the form
  3241.  
  3242.   MakeFile.c 43 981
  3243.   Count.c 153 3327
  3244.   Total 196 4303
  3245.  
  3246.   Files | Count -l
  3247.  
  3248.   Displays the total number of files and directories in the current
  3249.   directory.
  3250.  
  3251.   Count -l §
  3252.  
  3253.   Displays the number of lines selected in the target window.
  3254.  
  3255.     • Note: The source code for Count is included in the CExamples
  3256.     folder in the file Count.c, as part of MPW C.
  3257.  
  3258. æKY CPlus
  3259. æC                CPlus -- script to compile C++ source
  3260.  
  3261. CPlus [option…] [file…] < file > intermediate output ≥ progress
  3262.     -a                      # force ANSI-style intermediate C code (default)
  3263.     -a0                     # force K&R-style (pre-ANSI) intermediate C code
  3264.     -a1                     # force ANSI-style intermediate C code (default)
  3265.     -b                      # put string constants into code and generate PC-relative references
  3266.     -b2                     # implies '-b' above, and allows string constants to be overlaid
  3267.     -b3                     # overlaid string constants in code (but not PC-relative refs.)
  3268.     -c                      # intermediate code to standard output; no object file
  3269.     -d name                 # equivalent to: #define name 1
  3270.     -d name=string          # equivalent to: #define name string
  3271.     -e                      # write preprocessor results to output
  3272.     -e2                     # implies '-e' above, and strips comments
  3273.     -elems881               # generate MC68881 code for transcendentals
  3274.     -f filename             # act as if input comes from named file when it actually is from stdin 
  3275.     -f1                     # send text version of C code to C compiler (no token stream)
  3276.     -i directory            # search for includes in directory
  3277.     -m                      # generate 32-bit references for data (less efficient code)
  3278.     -mbg ch8                # MPW 2.0 compatible macsbug symbols
  3279.     -mbg off                # no macsbug symbols in the code (link/unlk only if necessary)
  3280.     -mbg on|full            # full macsbug symbols
  3281.     -mbg <n>                # macsbug symbols to length <n> (<n> can be 0..63)
  3282.     -mc68020                # generate MC68020 code 
  3283.     -mc68881                # generate MC68881 code for arithmetic operations
  3284.     -mtbl0                  # suppress output of method tables for Object Pascal Classes
  3285.     -mtbl1                  # force output of method tables for Object Pascal Classes
  3286.     -n                      # Turn pointer assignment incompatibilty errors into warnings
  3287.     -o objname              # generate code in file or directory objname
  3288.     -p                      # write progress information to diagnostic
  3289.     -s segment              # generate code in segment
  3290.     -sym off                # no SADE records
  3291.     -sym on|full            # full SADE records; can modify with [,nolines] [,notypes] [,novars]
  3292.     -t                      # write C compilation time to diagnostic
  3293.     -u name                 # equivalent to: #undef name
  3294.     -vtbl0                  # suppress output of virtual tables for ordinary class
  3295.     -vtbl1                  # force output of virtual tables for ordinary class
  3296.     -vtbl2                  # new improved output algorithm for virtual tables
  3297.     -w                      # suppress warnings
  3298.     -w1                     # generate additional warnings from CFront
  3299.     -w3                     # passed through to C compiler (supresses unused warnings)
  3300.     -y directory            # create temporary files in directory
  3301.     -z0                     # force 'inline' functions to be non-inline
  3302.     -z3                     # supress name encoding of local vars and struct members (default)
  3303.     -z4                     # encode names of local vars and struct members
  3304.     -z6                     # force enums always to be int variables
  3305.     -z7                     # relax requirement on static class member initialization 
  3306.  
  3307. Status codes returned:
  3308.   0    Successful completion.
  3309.   1    Errors occurred.
  3310.  
  3311.                            Description
  3312.  
  3313.   CPlus compiles the specified C++ source file. Compiling file Name.cp
  3314.   creates object file Name.cp.o. (By convention, C++ source filenames
  3315.   end in a “.cp” suffix.) If no filenames are specified, standard input
  3316.   is compiled and the object file “c.o” is created.
  3317.  
  3318.   (Note that SADE object file information cannot be generated for standard
  3319.   input source files.)
  3320.  
  3321.   The CPlus script activates, in turn, CFront, and the MPW C Compiler.
  3322.   (CFront consists of two components: a C preprocessor and a C++ to
  3323.   C translator.)
  3324.  
  3325.   See the MPW 3.0 C++ Reference Manual for details of the MPW C++ language
  3326.   definition.
  3327.  
  3328.  
  3329.                              Examples
  3330.  
  3331.   cplus -p Sample.c
  3332.  
  3333.   Compiles Sample.c, producing the object file Sample.c.o. Writes progress
  3334.   information to diagnostic output. (Sample.c is found in Examples:CPlusExamples.)
  3335.  
  3336.  
  3337.                              See also 
  3338.  
  3339.   MPW 3.0 C Reference, MPW C++ Reference.
  3340.  
  3341. æKY CreateMake
  3342. æC                CreateMake -- create a simple makefile
  3343.  
  3344. CreateMake [ -Application [ -c creator ] | -Tool | -DA | SIOW
  3345.          -CR -m mainEntryPoint -rt resourceType | -SIOW 
  3346.          [ -t type ] [ -c creator ] ] [-sym on]
  3347.          [-mc68020 | -mc68881 | -elems881] program file…
  3348.     -Application        # create an Application (default)
  3349.     -c creator          # optional Creator for Application or Code Resource
  3350.     -Tool               # create a Tool
  3351.     -DA                 # create a Desk Accessory
  3352.     -CR                 # create a Code Resource
  3353.     -SIOW               # create a Simple Input/Output Window
  3354.     -m mainEntryPoint   # required Main Entry Point for Code Resource
  3355.     -rt resourceType    # required Resource Type for Code Resource
  3356.     -t type             # optional File Type for Code Resource
  3357.     -sym on             # include SADE information in the object file
  3358.     -mc68020            # generate 68020 instructions
  3359.     -mc68881            # generate 68881 instructions for elementary operations
  3360.     -elems881           # generate 68881 instructions for transcendental functions
  3361.  
  3362. Status codes returned:
  3363.   0    Successful completion.
  3364.   1    Parameter or option error.
  3365.  
  3366.                            Description
  3367.  
  3368.   CreateMake creates a simple makefile for building the specified program.
  3369.   The parameter program is the name of the program. Makefile program.make
  3370.   is created. The list of files includes both source and library files.
  3371.   Source files may be written in any combination of assembly language
  3372.   (suffix “.a”), C (“.c”), C++ (“.cp”), Pascal (“.p”), and/or Rez (“.r”).
  3373.  
  3374.   You can also specify Library files (suffix “.o”). Link the program
  3375.   with these files. CreateMake automatically links with the library
  3376.   files listed below. It is not necessary to specify these files as
  3377.   parameters to CreateMake.
  3378.  
  3379.   You can create Makefiles for building applications (the default),
  3380.   desk accessories, and tools.
  3381.  
  3382.   CreateMake generates commands that link the program with the following
  3383.   set of MPW libraries:
  3384.  
  3385.     • Inside Macintosh Interfaces
  3386.         {Libraries}Interface.o
  3387.     • Runtime support—one of the following:
  3388.         {Libraries}Stubs.o # a tool is to be built
  3389.         {Libraries}Runtime.o # no C object files
  3390.         {CLibraries}CRuntime.o # any C object files
  3391.     • C Libraries—if any source is in C
  3392.         {CLibraries}StdCLib.o
  3393.         {CLibraries}CSANELib.o
  3394.         {CLibraries}Math.o
  3395.         {CLibraries}CInterface.o
  3396.     • C Libraries—if any source is in C++
  3397.         {CLibraries}CPlusStreams.o # a tool is to be built
  3398.         {CLibraries}CPlusStubs.o # a DA is to be built
  3399.         {CLibraries}CSANELib.o
  3400.         {CLibraries}Math.o
  3401.         {CLibraries}CInterface.o
  3402.     • Pascal Libraries—if any source is in Pascal
  3403.         {PLibraries}PasLib.o
  3404.         {PLibraries}SANELib.o
  3405.     • For tools:
  3406.         {Libraries}ToolLibs.o
  3407.     • For desk accessories:
  3408.         {Libraries}DRVRRuntime.o
  3409.  
  3410.   CreateMake does not include dependencies on include files and USES
  3411.   files in the makefile. Libraries other than those listed above are
  3412.   not included in the Link command generated by CreateMake, unless
  3413.   specified as parameters. CreateMake is used to implement the Create
  3414.   Build Commands item in the Build menu.
  3415.  
  3416.  
  3417.                              Examples
  3418.  
  3419.   CreateMake -tool count count.c count.r
  3420.  
  3421.   Creates the makefile Count.make containing commands for building
  3422.   the tool Count from the source files Count.c and Count.r. The makefile
  3423.   is similar to the following:
  3424.  
  3425.   # File: count.make
  3426.   # Target: count
  3427.   # Sources: count.c count.r
  3428.   # Created: Thursday, June 2, 1988 5:33:38 PM
  3429.  
  3430.   count.c.o ƒ count.make count.c
  3431.       C count.c
  3432.  
  3433.   count ƒƒ count.make count.r
  3434.       Rez count.r -append -o count
  3435.  
  3436.   SOURCES = count.c count.r
  3437.   OBJECTS = count.c.o
  3438.  
  3439.   count ƒƒ count.make {OBJECTS}
  3440.  
  3441.       Link -w -t MPST -c ‘MPS ’ ∂
  3442.           “{Libraries}”Stubs.o ∂
  3443.           “{CLibraries}”CRuntime.o ∂
  3444.           “{Libraries}”Interface.o ∂
  3445.           “{CLibraries}”StdCLib.o ∂
  3446.           “{CLibraries}”CSANELib.o ∂
  3447.           “{CLibraries}”Math.o ∂
  3448.           “{CLibraries}”CInterface.o ∂
  3449.           “{Libraries}”ToolLibs.o ∂
  3450.           “{OBJECTS}” ∂
  3451.           -o count
  3452.  
  3453.  
  3454.                              See also 
  3455.  
  3456.   BuildMenu and BuildProgram commands.
  3457.  
  3458.   “Building a Program: An Introduction” in Chapter 2.
  3459.  
  3460. æKY CreateMakeIIGS
  3461. æC      CreateMakeIIGS -- creates Make files that build programs
  3462. CreateMakeIIGS [option…] program file… 
  3463.  -Application            # create an Apple IIGS Application (default)
  3464.  -CDA                    # create an Apple IIGS Classic Desk Accessory
  3465.  -NDA                    # create an Apple IIGS New Desk Accessory
  3466.  -Tool                   # create an APW Tool
  3467.  -s stacksize            # set the stack size
  3468.  -d                      # generate DuplicateIIGS command after link
  3469. æKY Cut
  3470. æC           Cut -- copy selection to Clipboard and delete it
  3471.  
  3472. Cut [-c count] selection [window]
  3473.  -c count                # cut the next count selections
  3474.  
  3475. Status codes returned:
  3476.   0    At least one instance of the selection was found.
  3477.   1    Syntax error.
  3478.   2    Any other error.
  3479.  
  3480.                            Description
  3481.  
  3482.   Finds selection in the specified window, copies its contents to the
  3483.   Clipboard, and then deletes the selection. If no window is specified,
  3484.   the command operates on the target window (the second window from
  3485.   the front). It’s an error to specify a window that doesn’t exist.
  3486.  
  3487.   For a definition of selection, see “Selections” in Chapter 6 of the MPW
  3488.   manual; a summary of the selection syntax is contained in Appendix B.
  3489.  
  3490.  
  3491.                              Examples
  3492.  
  3493.   Cut §
  3494.  
  3495.   Cuts the current selection in the target window. (This is the same
  3496.   as the Cut menu item, except that it operates on the target window
  3497.   rather than the active window.)
  3498.  
  3499.   Cut /BEGIN/:/END/
  3500.  
  3501.   Selects everything from the next BEGIN through the following END,
  3502.   copies the contents of the selection to the Clipboard, and then deletes
  3503.   the selection.
  3504.  
  3505.  
  3506.                              See also 
  3507.  
  3508.   Clear, Copy, and Paste commands.
  3509.  
  3510.   “Selections” in Chapter 6 and in Appendix B.
  3511.  
  3512. æKY Date
  3513. æC                    Date -- write the date and time
  3514.  
  3515. Date ([-a | -s] [-d | -t] [-c seconds]) | [-n] > date
  3516.   -a                       # abbreviated date (e.g. Wed, Jun 18, 1986)
  3517.   -s                       # short date (e.g. 6/18/86)
  3518.   -d                       # write date only
  3519.   -t                       # write time only
  3520.   -c seconds               # write date corresponding to seconds
  3521.   -n                       # write seconds since January 1, 1904
  3522. \.
  3523. Status codes returned:
  3524.   0    No error.
  3525.   1    Syntax error.
  3526.  
  3527.                            Description
  3528.  
  3529.   Writes the current date and time to standard output in a variety
  3530.   of standard and user-specified formats. Date arithmetic is supported
  3531.   with the -n and -c options that work with the number of seconds since
  3532.   January 1, 1904. With no options the Date output has this form: Thursday,
  3533.   August 30, 1988 10:45:51 A.M.
  3534.  
  3535.  
  3536.                              Examples
  3537.  
  3538.   Date
  3539.  
  3540.   returns the date in the form
  3541.   Friday, February 14, 1988 10:34:25 PM
  3542.  
  3543.   Date -a
  3544.  
  3545.   returns
  3546.   Fri, Feb 14, 1988 10:34:25 PM
  3547.  
  3548.   Date -s -d
  3549.  
  3550.   returns
  3551.   2/14/86
  3552.  
  3553.   Set starttime `Date -n`
  3554.   BuildMyProgram
  3555.   Set endTime `Date -n`
  3556.   Echo Total time for BuildMyProgram ∂
  3557.   `Evaluate {endTime} - {startTime}`
  3558.  
  3559.   This example demonstrates how date arithmetic may be used to show
  3560.   how long a tool or script takes to execute.
  3561.  
  3562. æKY Delete
  3563. æC                Delete -- delete files and directories
  3564.  
  3565. Delete [-y | -n | -c] [-i] [-p] name…  ≥ progress
  3566.  -y                # delete directory contents (avoids dialog)
  3567.  -n                # don't delete directory contents (avoids dialog)
  3568.  -c                # cancel if a directory is to be deleted (avoids dialog)
  3569.  -i                # ignore errors (no diagnostics)
  3570.  -p                # write progress information to diagnostics
  3571.   
  3572. Status codes returned:
  3573.   0    All specified objects were deleted (except for any directories skipped 
  3574.        with the -n option).
  3575.   1    Syntax error.
  3576.   2    An error occurred during the delete.
  3577.   4    Cancel was selected or implied by the -c option.
  3578.  
  3579.                            Description
  3580.  
  3581.   Deletes file or directory name. If name is a directory, name and
  3582.   its contents (including all subdirectories) are deleted.
  3583.  
  3584.   Before deleting directories, a dialog box will request confirmation
  3585.   for the deletion. Use the -y, -n, or -c options in scripts to avoid
  3586.   this interaction. Be sure to see the warning at the end of this section.
  3587.  
  3588.  
  3589.                              Examples
  3590.  
  3591.   Delete HD:MPW:≈.c
  3592.  
  3593.   Deletes all items in the MPW folder that end in “.c”. (Recall that
  3594.   the Shell first replaces the parameter “≈.c” with a list of filenames
  3595.   matching the pattern—the Delete command then deletes each of these
  3596.   files.)
  3597.  
  3598.   Warning Beware of potentially disastrous typographical mistakes such
  3599.   as the following:
  3600.  
  3601.   Delete ≈ .c
  3602.  
  3603.   Note the space after “≈”—this space causes “≈” and “.c” to be treated
  3604.   as two separate parameters. In this case, Delete deletes all files
  3605.   in the current directory and also attempts to delete a file named
  3606.   “.c”.
  3607.  
  3608.   Also note that the following command deletes everything:
  3609.  
  3610.   Delete ≈:
  3611.  
  3612.   That is, the filename pattern ≈: expands to the names of all volumes
  3613.   online (including the startup volume!).
  3614.  
  3615.   When deleting files en masse, it’s a good practice to use the Echo
  3616.   command to verify the action of the filename generation operators;
  3617.   for example,
  3618.  
  3619.   Echo ≈.c
  3620.  
  3621.  
  3622.                              See also 
  3623.  
  3624.   Clear command (for deleting selections).
  3625.  
  3626.   “Filename Generation” in Chapter 5.
  3627.  
  3628. æKY DeleteMenu
  3629. æC        DeleteMenu -- delete user-defined menus and menu items
  3630.  
  3631. DeleteMenu [menuName [itemName]]
  3632.  
  3633. Status codes returned:
  3634.   0    No errors.
  3635.   1    Syntax error.
  3636.   2    Other errors.
  3637.  
  3638.                            Description
  3639.  
  3640.   Deletes the user-defined item itemName in the menu menuName. If itemName
  3641.   is omitted, all user-defined items for menuName are deleted.
  3642.  
  3643.   s Caution If itemName and menuName are both omitted, all user-defined
  3644.   items are deleted. Menu items that haven’t been added with AddMenu
  3645.   can’t be deleted with DeleteMenu.  s
  3646.  
  3647.  
  3648.                              Examples
  3649.  
  3650.   DeleteMenu File
  3651.  
  3652.   Deletes all user-defined items from the File menu.
  3653.  
  3654.  
  3655.                              See also 
  3656.  
  3657.   AddMenu command.
  3658.  
  3659. æKY DeleteNames
  3660. æC           DeleteNames -- delete user-defined symbolic names
  3661.  
  3662. DeleteNames [-u user] [-private] [-project project] [-public] [-r] [names… | -a]
  3663.   -u user                 # name of current user
  3664.   -private                # delete private names
  3665.         -project project        # name of project that contains the files
  3666.   -public                 # delete public names
  3667.   -r                      # delete names recursively
  3668.   -a                      # delete all names
  3669.  
  3670. Status codes returned:
  3671.   0    No errors.
  3672.   1    Syntax error.
  3673.   2    Error in processing.
  3674.  
  3675.                            Description
  3676.  
  3677.   Delete symbolic names used to represent a set of revisions under
  3678.   Projector. You can create symbolic names by using the NameRevisions
  3679.   command.
  3680.  
  3681.   You can use the -log option of the ProjectInfo command to see which
  3682.   names have been deleted and what their values were.
  3683.  
  3684.   See Chapter 7 of MPW Manual for complete definitions of the terms and 
  3685.   symbols used in Projector commands.
  3686.  
  3687.  
  3688.                              Examples
  3689.  
  3690.   Suppose you have created a Name “Work” that is expanded to the
  3691.   files file.c and interactive.c using the command
  3692.  
  3693.   NameRevisions Work file.c interactive.c
  3694.  
  3695.   Then:
  3696.  
  3697.   DeleteNames Work
  3698.  
  3699.   removes “Work” from the list of symbolic names.
  3700.  
  3701.  
  3702.                              See also 
  3703.  
  3704.   NameRevisions, ProjectInfo.
  3705.  
  3706.  
  3707. æKy DeletePane
  3708. æC                          DeletePane --  delete all panes from the window
  3709.  
  3710. DeletePane [window]
  3711.  
  3712.  
  3713.  
  3714. æKY DeleteRevisions
  3715. æC  DeleteRevisions -- delete previous revisions of files in a project
  3716.  
  3717. DeleteRevisions [-u user] [-project project] [-file] [-y] revision…
  3718.     -u user                 # name of current user
  3719.     -project project        # name of project that contains the files
  3720.     -file                   # deletes the file and all its revisions
  3721.     -y                      # delete the file/revision (avoids dialog)
  3722.  
  3723. Status codes returned:
  3724.   0    No errors.
  3725.   1    Syntax error.
  3726.   2    Error in processing.
  3727.   3    System error.
  3728.  
  3729.                            Description
  3730.  
  3731.   Delete old revisions by specifying the oldest revision that you want
  3732.   to keep. All prior revisions are deleted. Delete all revisions on
  3733.   a branch by naming the branch or branches in the named files under
  3734.   Projector. It is an error to try to delete a revision that is currently
  3735.   checked out for modification.
  3736.  
  3737.   Revision is either a filename, a filename followed by a comma and
  3738.   a revision number, or a filename followed by a comma and a branch
  3739.   name (such as
  3740.  
  3741.   foo.c,22a).
  3742.  
  3743.   You can use the -file option to remove the file and all of its revisions
  3744.   from the project.
  3745.  
  3746.   s Warning DeleteRevisions permanently removes the revisions and branches
  3747.   specified. They cannot be recovered.  s
  3748.  
  3749.   You can use the -log option of the ProjectInfo command to see which
  3750.   revisions have been deleted and who deleted them.
  3751.  
  3752.   See Chapter 7 of the MPW Manual for complete definitions of the terms and 
  3753.   symbols used in Projector commands.
  3754.  
  3755.  
  3756.                              Examples
  3757.  
  3758.   DeleteRevisions -project Zoom∫Utilities∫MyProject file.c
  3759.  
  3760.   This example deletes all revisions except the latest in file.c in
  3761.   the named project.
  3762.  
  3763.   DeleteRevisions file.c,22a3
  3764.  
  3765.   This example deletes all revisions on branch 22a before revision
  3766.   3 of file.c.
  3767.  
  3768.   DeleteRevisions file.c,22a
  3769.  
  3770.   This command deletes all the revisions on branch 22a in file.c of
  3771.   the current project.
  3772.  
  3773.   DeleteRevisions -file file.c
  3774.  
  3775.   This command deletes the file file.c and all of its revisions from
  3776.   the current project.
  3777.  
  3778.  
  3779.                              See also 
  3780.  
  3781.   NameRevisions, ProjectInfo.
  3782.  
  3783. æKY DeRez
  3784. æC                     DeRez -- resource decompiler
  3785.  
  3786. DeRez [option…] resourceFile [file…]  > description ≥ progress
  3787.     -c[ompatible]           # generate output compatible with Rez 1.0
  3788.     -e[scape]               # don't escape chars < $20 or > $D8
  3789.     -d[efine] name[=value]  # equivalent to #define name [value]
  3790.     -i[nclude] pathname     # search this path when looking for #include files
  3791.     -m[axstringsize] n      # write strings n characters per line
  3792.     -only typeExpr          # process only resources of this type
  3793.     -p[rogress]             # write progress information to diagnostics
  3794.     -rd                     # suppress warnings for redeclared types
  3795.     -s[kip] typeExpr        # skip resources of this type
  3796.     -u[ndef] name           # equivalent to #undef name
  3797.  
  3798.     Note: A typeExpr may have one of these forms:
  3799.           type
  3800.         "'type'(id)"
  3801.         "'type'(id:id)"
  3802.         "'type'(∂"name∂")"
  3803.  
  3804. Status codes returned:
  3805.   0    No errors.
  3806.   1    Error in parameters.
  3807.   2    Syntax error in file.
  3808.   3    I/O or program error.
  3809.  
  3810.                            Description
  3811.  
  3812.   Creates a text representation (resource description) of the resource
  3813.   fork of resourceFile, according to the resource type declarations
  3814.   in the resource description file(s). The resource description is
  3815.   written to standard output.
  3816.  
  3817.   A resource description file is a file of type declarations in the
  3818.   format used by the resource compiler, Rez. The type declarations
  3819.   for standard Macintosh resources are contained in the files Types.r
  3820.   and SysTypes.r, contained in the {RIncludes} folder. If no resource
  3821.   description file is specified, the output consists of data statements
  3822.   giving the resource data in hexadecimal form, without any additional
  3823.   format information.
  3824.  
  3825.   If the output of DeRez is used as input to Rez, with the same resource
  3826.   description files, it produces the same resource fork that was originally
  3827.   input to DeRez. DeRez is not guaranteed to be able to run a declaration
  3828.   backwards; if it can’t, it produces a data statement instead of the
  3829.   appropriate resource statement.
  3830.  
  3831.   DeRez ignores all include (but not #include), read, data, change,
  3832.   delete, and resource statements found in the resourceDescriptionFile.
  3833.   (It still parses these statements for correct syntax.)
  3834.  
  3835.   For the format of resource type declarations, see Chapter 11 and
  3836.   Appendix D of the MPW manual.
  3837.  
  3838.  
  3839.                              Examples
  3840.  
  3841.   DeRez “{ShellDirectory}MPW Shell” -only MENU Types.r
  3842.  
  3843.   Displays all of the 'MENU' resources used by the MPW Shell. The type
  3844.   definition for 'MENU' resources is found in the file Types.r.
  3845.  
  3846.   DeRez HD:OS:System SysTypes.r ∂
  3847.   -only “'DRVR' (∂“\\0x00Scrapbook∂”)”
  3848.  
  3849.   Decompiles the Scrapbook desk accessory in the copy of the System
  3850.   file that’s located in directory HD:OS:. (The type definition for
  3851.   'DRVR' resources is found in the file SysTypes.r.)
  3852.  
  3853.  
  3854.                              See also 
  3855.  
  3856.   Rez and RezDet commands.
  3857.  
  3858.   Chapter 11.
  3859.  
  3860.   Type declaration files in RIncludes folder:
  3861.  
  3862.     • Types.r
  3863.  
  3864.     • SysTypes.r
  3865.  
  3866.     • MPWTypes.r
  3867.  
  3868.     • Pict.r
  3869.  
  3870. æKY DeRezIIGS
  3871. æC                DeRezIIGS -- resource decompiler
  3872. DeRezIIGS [option…] resourceFile [file…]  > description ≥ progress
  3873.  -c[ompatible]           # generate output compatible with Rez 1.0
  3874.  -e[scape]               # don't escape chars < $20 or > $D8
  3875.  -d[efine] name[=value]  # equivalent to #define name [value]
  3876.  -i[nclude] pathname     # search this path when looking for #include files
  3877.  -m[axstringsize] n      # write strings n characters per line
  3878.  -only typeExpr          # process only resources of this type
  3879.  -p[rogress]             # write progress information to diagnostics
  3880.  -rd                     # suppress warnings for redeclared types
  3881.  -s[kip] typeExpr        # skip resources of this type
  3882.  -u[ndef] name           # equivalent to #undef name
  3883.  
  3884.  Note: A typeExpr may have one of these forms:
  3885.      type
  3886.    "'type'(id)"
  3887.    "'type'(id:id)"
  3888.    "'type'(∂"name∂")"
  3889. æKY Directory
  3890. æC           Directory -- set or write the default directory
  3891.  
  3892. Directory [-q | directory]   > directory
  3893.  -q                      # don't quote directories with special characters
  3894.  
  3895. Status codes returned:
  3896.   0    No error.
  3897.   1    Directory not found, command aborted, or parameter error.
  3898.  
  3899.                            Description
  3900.  
  3901.   If specified, directory becomes the new default directory. Otherwise
  3902.   the pathname of the current default directory is written to standard
  3903.   output.
  3904.  
  3905.   If directory is a leafname, the command searches for directory in
  3906.   the directories listed in the Shell variable {DirectoryPath}. If
  3907.   the variable is undefined, the command looks in the current directory.
  3908.  
  3909.     • Note: To display a directory’s contents, use the Files command.
  3910.  
  3911.  
  3912.                              Examples
  3913.  
  3914.   Directory
  3915.  
  3916.   Writes the pathname of the current directory to standard output.
  3917.  
  3918.   Directory HD:MPW:Examples:
  3919.  
  3920.   Sets the default directory to the folder Examples in the folder MPW
  3921.   on the volume HD. The final colon is optional.
  3922.  
  3923.   Directory Reports:
  3924.  
  3925.   Sets the default directory to the volume Reports. Note that volume
  3926.   names must end in a colon.
  3927.  
  3928.   Directory :Include:Pascal:
  3929.  
  3930.   Sets the default directory to the folder Pascal in the folder Include
  3931.   in the current default directory.
  3932.  
  3933.   Set DirectoryPath “:, {MPW}, {MPW}Projects:”
  3934.  
  3935.   Directory Tools
  3936.  
  3937.   Sets the directory to the Tools directory. The current directory
  3938.   is searched first, followed by the {MPW} directory, and finally by
  3939.   the {MPW} Projects directory. If there is no Tools directory in your
  3940.   current directory, the directory is set to {MPW}Tools.
  3941.  
  3942.  
  3943.                              See also 
  3944.  
  3945.   “File and Window Names” in Chapter 4.
  3946.  
  3947.   Files, NewFolder, and SetDirectory commands.
  3948.  
  3949. æKY DirectoryMenu
  3950. æC        DirectoryMenu [directory…] -- create the Directory menu
  3951.  
  3952. Status code returned:
  3953.    0    no errors always returned.
  3954.  
  3955.                            Description
  3956.  
  3957.   Creates the Directory menu shown here. The optional directory… parameter
  3958.   specifies the initial list of directories that appears in the menu.
  3959.   The menu items are described in Chapter 3 of the MPW manual.
  3960.  
  3961.   The lower section of the Directory menu contains a list of directories.
  3962.   Initially this list consists of the parameters to DirectoryMenu.
  3963.   As other directories become the current directory (using the Set
  3964.   Directory menu item or the SetDirectory command), they are added
  3965.   to the list.
  3966.  
  3967.  
  3968.                              Examples
  3969.  
  3970.   DirectoryMenu `(Files -d -i {MPW}Examples:≈) ≥ Dev:Null` `Directory`
  3971.  
  3972.   Creates the Directory menu. Directories in directory {MPW} that match
  3973.   the pattern Examples:≈ will be included in the Directory menu, along
  3974.   with the current directory.
  3975.  
  3976.   This DirectoryMenu command should be included in your UserStartup
  3977.   file to install the Directory menu. You might replace the Examples
  3978.   directories and the default directory with your favorite list of
  3979.   directories.
  3980.  
  3981. æKY DoIt
  3982. æC       DoIt -- highlight and execute a series of shell commands
  3983.  
  3984. DoIt (CommandFile [-echo] [-dump]) | [-selection]
  3985.  -echo                   # echo commands before execution
  3986.  -dump                   # dump unexecuted commands after error
  3987.  -selection              # execute command in the current selection
  3988.  
  3989. Status codes returned:
  3990.   0    No errors.
  3991.   1    Syntax error.
  3992.  
  3993.                            Description
  3994.  
  3995.   DoIt will execute a series of Shell commands, highlighting each command
  3996.   as it is executed. The commands can be either in a file or in the
  3997.   current selection of the active window. If a CommandFile is passed
  3998.   to DoIt, the file is opened (as the active window) and each command
  3999.   is executed. The window is closed when all commands have been processed.
  4000.  
  4001.   This command will not work for a series of commands that contains
  4002.   structured commands such as If statements or Loops.
  4003.  
  4004.  
  4005.                              Examples
  4006.  
  4007.   Backup -from “HD:Src:” -to “Backup:Src” -a -r -c > out
  4008.  
  4009.   DoIt out
  4010.  
  4011.   The above command will highlight and execute all the Duplicate commands
  4012.   generated by the Backup command. In this way you can see progress
  4013.   as the files are being duplicated.
  4014.  
  4015.   AddMenu DoIt “DoIt Selection” “DoIt -selection”
  4016.  
  4017.   The above AddMenu command will create a menu that can be used to
  4018.   highlight and execute the current selection. This could be used on
  4019.   a series of commands generated by Make or Backup that were written
  4020.   to the Active window. Simply select the commands and select the “DoIt
  4021.   Selection” menu item.
  4022.  
  4023.   Make > make.out
  4024.  
  4025.   DoIt -dump make.out
  4026.  
  4027.   This DoIt command will open the make.out file and highlight and execute
  4028.   each of the commands generated by the previous make command. In this
  4029.   way you can see progress as the files are being compiled and linked.
  4030.   If an error occurs (for instance, in one of the compiles), that compile
  4031.   command along with the rest of the commands in the make.out will
  4032.   be written to the WorkSheet. At this point you could fix the error
  4033.   (in the source file), select the “ToDo” marker (which would select
  4034.   the remaining commands), and select the “DoIt Selection” menu item
  4035.   to execute the remaining commands.
  4036.  
  4037. æKY DumpCode
  4038. æC              DumpCode -- write formatted CODE resources
  4039.  
  4040. DumpCode [option…] resourceFile  > dump ≥ progress
  4041.     -a                      # Show offsets from beginning of segment
  4042.     -d                      # don't dump object code
  4043.                 -di                     # don't dump data initialization info
  4044.     -h                      # don't write headers (offsets, hex, etc.)
  4045.     -jt                     # don't dump jump table
  4046.     -n                      # dump only resource names
  4047.     -p                      # write progress information to diagnostics
  4048.     -r byte1[,byte2]        # dump code from address byte1 (through byte2)
  4049.                 -ri                     # don't dump a5- and segment-relocation info
  4050.     -rt type[=id]           # dump only resources with this type (and id)
  4051.     -s name                 # dump only resource with this name
  4052.  
  4053. Status codes returned:
  4054.   0    No problem.
  4055.   1    Syntax error.
  4056.   2    Fatal error.
  4057.  
  4058.                            Description
  4059.  
  4060.   Disassembles object code that is stored in resources such as 'CODE',
  4061.   'DRVR', and 'PDEF'. DumpCode reads from the resource fork of the
  4062.   specified file and writes the formatted assembly code to standard
  4063.   output. The default formatting convention is to disassemble the code
  4064.   and to display the corresponding bytes in hexadecimal and ASCII.
  4065.  
  4066.   The default behavior of DumpCode is to dump all the 'CODE' resources
  4067.   from a program file. The -rt option can be used to dump resources
  4068.   of other types, such as drivers and desk accessories.
  4069.  
  4070.   Some conventions about executable code resources are built into DumpCode
  4071.   and affect the formatted output in special ways:
  4072.  
  4073.     • 'CODE' resources with ID 0 are formatted as a jump table (unloaded
  4074.     format).
  4075.  
  4076.     • Other 'CODE' resources have information about jump table entries
  4077.     in the first four bytes.
  4078.  
  4079.     • 'DRVR' resources have a special format at the beginning of
  4080.     the resource.
  4081.  
  4082.   In addition, you can direct DumpCode to give a symbolic dump of data
  4083.   initialization descriptors and initial values.
  4084.  
  4085.  
  4086.                              Examples
  4087.  
  4088.   DumpCode Sample > SampleDump
  4089.  
  4090.   Formats the 'CODE' resources in the file Sample, writing the output
  4091.   to the file SampleDump. The output has this format:
  4092.  
  4093.   File: sample, Resource 3, Type: CODE, Name: _DataInit
  4094.   Offset of first jump table entry: $00000018
  4095.   Segment is $000000D2 bytes long, and uses 1 jump table entry
  4096.   000000: 48E7 FFF0 'H...' MOVEM.L D0-D7/A0-A3,-(A7)
  4097.   000004: 4247 'BG' CLR.W D7
  4098.   000006: 4EAD 0032 'N..2' JSR $0032(A5)
  4099.   00000A: 2218 '“.' MOVE.L (A0)+,D1
  4100.   etc.
  4101.  
  4102.  
  4103.                              See also 
  4104.  
  4105.   DumpObj command.
  4106.  
  4107.   “The Jump Table” in the chapter “Segment Loader” of Inside Macintosh,
  4108.   for a description of the jump table.
  4109.  
  4110.   Appendix H, “Object File Format.”
  4111.  
  4112. æKY DumpFile
  4113. æC               DumpFile -- display contents of any file
  4114.  
  4115. DumpFile  [ option… ]  filename > dump ≥ progress
  4116.  -rf                # display the resource fork of the file. (Default is 
  4117.                     # data fork.)
  4118.  -bf                # display both forks of the file
  4119.  -a                 # suppress display of ASCII character values. 
  4120.  -h                 # suppress display of hexadecimal characters.
  4121.  -o                 # suppress display of file offsets.
  4122.  -w nn              # width - display nn bytes on each line of output.
  4123.  -g nn              # group nn bytes together without intervening spaces.
  4124.  -p                 # write progress information to diagnostic output.
  4125.  -r byte1[,byteN]   # display only the byte range from byte1 to byteN.
  4126.  
  4127. Status codes returned:
  4128.   0    No problem.
  4129.   1    Syntax error.
  4130.   2    Fatal error.
  4131.  
  4132.                            Description
  4133.  
  4134.   DumpFile lets you display the contents of the resource fork or data
  4135.   fork of a file in a variety of formats.
  4136.  
  4137.  
  4138.                              Examples
  4139.  
  4140.   DumpFile -p ATestFile
  4141.  
  4142.   Formats the data fork of the file ATestFile and writes its contents
  4143.   to standard output. This output has the following format:
  4144.  
  4145.   DumpFile -p ATestFile
  4146.  
  4147.   MPW File Display Utility Version 3.0B1 Release April 15,
  4148.   1988 Start: 1:24:09 PM 4/19/88
  4149.  
  4150.   Copyright Apple Computer, Inc. 1985-1988
  4151.   All Rights Reserved.
  4152.  
  4153.   File : ATestFile
  4154.   Data Fork Length : 20
  4155.   Resource Fork Length : 382
  4156.   Dumping Data Fork from offset 0 to 20
  4157.  
  4158.     0: 54 68 69 73 20 69 73 20 61 20 74 65 73 74 20 66 This.is.a.test.file.
  4159.    10: 69 6C 65 2E
  4160.   DumpFile completed normally
  4161.   Execution required 0 seconds.
  4162.  
  4163.   DumpFile -w 12 -g 4 ATestFile
  4164.  
  4165.   Formats the data fork of the file ATestFile and writes its contents
  4166.   to standard output, grouping four bytes at a time and displaying
  4167.   12 bytes per line. This output has the following format:
  4168.  
  4169.   File : ATestFile
  4170.   Data Fork Length : 20
  4171.   Resource Fork Length : 382
  4172.   Dumping Data Fork from offset 0 to 20
  4173.  
  4174.     0: 54686973 20697320 61207465 This.is.a.te
  4175.     C: 73742066 696C652E st.file.
  4176.  
  4177.   DumpFile -rf -r 0,30 -g 4 ATestFile
  4178.  
  4179.   Formats the resource fork of the file ATestFile and writes the contents
  4180.   of bytes 0 through 30 to standard output in 4-byte groups. This output
  4181.   has the following format:
  4182.  
  4183.   File : ATestFile
  4184.   Data Fork Length : 20
  4185.   Resource Fork Length : 382
  4186.   Dumping Resource Fork from offset 0 to 30
  4187.  
  4188.     0: 00000100 0000014C 0000004C 00000032 .......L...L...2
  4189.    10: 696C652E 6F727920 2227227B 646972 ile.ory.“'”{dir
  4190.  
  4191. æKY DumpObj
  4192. æC                DumpObj -- write formatted object file
  4193.  
  4194. DumpObj [option…] objectFile  > dump ≥ progress
  4195.     -d                      # don't dump object code
  4196.     -h                      # don't write headers (offsets, hex, etc.)
  4197.     -i                      # use ids, rather than names, in dump
  4198.     -jn                     # just use names, rather than ids, in dump
  4199.     -l                      # dump file locations of object records
  4200.     -m name                 # dump only module "name" or module containing
  4201.                                         # entry-point "name" (-m option may be used repeatedly)
  4202.     -n                      # dump only the dictionary of names
  4203.     -p                      # write progress information to diagnostics
  4204.     -r byte1[,byte2]        # dump code from byte1 in file (through byte2)
  4205.     -sym [Off]              # disable symbolic output 
  4206.          [On | Full]        # enable symbolic output (default), can be followed by:
  4207.             [,NoLabels]     #    omit label information
  4208.             [,NoLines]      #    omit source line information
  4209.             [,NoTypes]      #   omit type information
  4210.             [,NoVars]       #   omit variable information
  4211.    -mods                    # dump a module summary with entry point information
  4212.    -mh                      # omit module summary header
  4213.  
  4214. Status codes returned:
  4215.   0    No problem.
  4216.   1    Syntax error.
  4217.   2    Fatal error.
  4218.  
  4219.                            Description
  4220.  
  4221.   Disassembles object code that is stored in the data fork of an object
  4222.   file. By convention, object files end in the suffix “.o”. In addition,
  4223.   the object file must have type 'OBJ'.
  4224.  
  4225.  
  4226.                              Examples
  4227.  
  4228.   DumpObj Sample.p.o >SampleDump
  4229.  
  4230.   Formats the file Sample.p.o and writes its contents to the file SampleDump.
  4231.   This output has the following format:
  4232.  
  4233.   Dump of file sample.p.o
  4234.   First: Kind 0 Version 1
  4235.   Dictionary: FirstId 2
  4236.     2: Main
  4237.  
  4238.   Pad
  4239.   Module: Flags $00 ModuleId 1 SegmentId Main
  4240.   Content: Flags $00
  4241.   Contents offset 0000 size 006A
  4242.  
  4243.   000000: 4E56 FFFE 'NV..' LINK A6,#$FFFE
  4244.   000004: 2F07 '/.' MOVE.L D7,-(A7)
  4245.   000006: 42A7 'B.' CLR.L -(A7)
  4246.   000008: 3F3C 0080 '?<..' MOVE.W #$0080,-(A7)
  4247.   etc.
  4248.  
  4249.   For more information, see Appendix H.
  4250.  
  4251.  
  4252.                              See also 
  4253.  
  4254.   DumpCode command.
  4255.  
  4256.   Appendix H, “Object File Format.”
  4257.  
  4258. æKY DumpObjIIGS
  4259. æC                   DumpObjIIGS -- dumps OMF files
  4260. DumpObjIIGS [option…] filename >listing ≥ progress
  4261.  -a                  # print operands only
  4262.  -d                  # dump the file in disassembly format
  4263.  -h                  # dump the segment headers in hex
  4264.  -i                  # Assume short indexes at start of dump
  4265.  -l                  # dump only first and last lines of LCONST records
  4266.  -m                  # assume short accumulator at start of dump
  4267.  -n <segment>        # dump this segment name. May be multiply specified
  4268.  -o                  # dump segment headers only
  4269.  -p                  # print progress to stderr
  4270.  -s                  # print short form of headers
  4271.  -t                  # print expressions in infix form
  4272.  -x                  # dump segments in hexadecimal
  4273.  -xa                 # dump the entire file in hexadecimal
  4274. æKY Duplicate
  4275. æC             Duplicate -- duplicate files and directories
  4276.  
  4277. Duplicate [-y | -n | -c] [-p] [-d | -r] name… target  ≥ progress
  4278.  -y                      # overwrite target files (avoids dialog)
  4279.  -n                      # don't overwrite target files (avoids dialog)
  4280.  -c                      # cancel if conflict occurs (avoids dialog)
  4281.  -p                      # write progress information to diagnostics
  4282.  -d                      # duplicate data fork only
  4283.  -r                      # duplicate resource fork only
  4284.  
  4285. Status codes returned:
  4286.   0    All objects were duplicated.
  4287.   1    Syntax error.
  4288.   2    An error occurred.
  4289.   4    Cancel was selected or implied from the -c option.
  4290.  
  4291.                            Description
  4292.  
  4293.   Duplicates name to targetName. (Name and targetName are file or directory
  4294.   names.) If targetName is a file or doesn’t exist, the file or directory
  4295.   name is duplicated and named targetName. If targetName is a directory,
  4296.   the objects named are duplicated into that directory. (If more than
  4297.   one name is present, targetName must be a directory.) Created objects
  4298.   are given the same creation and modification dates as their source.
  4299.  
  4300.   If a directory is duplicated, its contents (including all subdirectories)
  4301.   are also duplicated. No directory duplicated can be a parent of targetName.
  4302.  
  4303.   Name can also be a volume; if targetName is a directory, name is
  4304.   copied into targetName.
  4305.  
  4306.   A dialog box requests a confirmation if the duplication would overwrite
  4307.   an existing file or folder. You can use the -y, -n, or -c option
  4308.   in scripts to avoid this interaction.
  4309.  
  4310.  
  4311.                              Examples
  4312.  
  4313.   Duplicate Aug86 “Monthly Reports”
  4314.  
  4315.   Assuming “Monthly Reports” is an existing directory, duplicates the
  4316.   file Aug86 into that directory.
  4317.  
  4318.   Duplicate File1 Folder1 “Backup Disk:”
  4319.  
  4320.   Duplicates File1 and Folder1 (including its contents) onto Backup
  4321.   Disk.
  4322.  
  4323.   Duplicate -y File1 File2
  4324.  
  4325.   Duplicates File1 to File2, overwriting File2 if it exists.
  4326.  
  4327.   Duplicate Disk1:≈ HD:Files:
  4328.  
  4329.   Duplicates all of the files on Disk1 into the directory HD:Files.
  4330.  
  4331.   Duplicate Disk1: HD:Files:
  4332.  
  4333.   Duplicates all of Disk1 (as a directory) into HD:Files.
  4334.  
  4335.   Limitation Duplicate doesn’t recognize folders on non-HFS disks.
  4336.  
  4337.  
  4338.                              See also 
  4339.  
  4340.   Move and Rename commands.
  4341.  
  4342.   “File and Window Names” in Chapter 4.
  4343.  
  4344.   “Filename Generation” in Chapter 5.
  4345.  
  4346. æKY DuplicateIIGS
  4347. æC        DuplicateIIGS -- moves files between Mac and GS/OS volumes
  4348. DuplicateIIGS [option…] -m[ac] name… target >listing ≥ progress
  4349. DuplicateIIGS [option…] -pdos  name… target >listing ≥ progress
  4350. DuplicateIIGS [-p] -l
  4351. DuplicateIIGS [-p] -lr
  4352.  -l         # list the root directory of the disk
  4353.  -lr        # list the root directory of the disk and all subdirectories 
  4354.  -m[ac]     # copy Macintosh files to ProDOS file system
  4355.  -n         # don't overwrite target files (avoids dialog)
  4356.  -p         # write progress information to diagnostics
  4357.  -pdos      # copy the ProDOS files to Macintosh file system
  4358.  -y         # overwrite target files (avoids dialog)
  4359.  -d         # copy only the data fork
  4360.  -r         # copy only the resource fork
  4361. æKY Echo
  4362. æC                      Echo -- echo parameters
  4363.  
  4364. Echo [-n] [parameter…]   > parameters
  4365.  -n                      # don't write return following the parameters
  4366.  
  4367. Status codes returned:
  4368.   0    is always returned.
  4369.  
  4370.                            Description
  4371.  
  4372.   Writes its parameters, separated by spaces and terminated by a return,
  4373.   to standard output. If no parameters are specified, only a return
  4374.   is written.
  4375.  
  4376.   Echo is especially useful for checking the results of variable substitution,
  4377.   command substitution, and filename generation.
  4378.  
  4379.  
  4380.                              Examples
  4381.  
  4382.   Echo “Use Echo to write progress info from scripts.”
  4383.  
  4384.   Use Echo to write progress info from scripts.
  4385.  
  4386.   The Echo command above writes the second line to standard output.
  4387.  
  4388.   Echo {Status}
  4389.  
  4390.   Writes the current value of the {Status} variable—that is, the status
  4391.   of the last command executed.
  4392.  
  4393.   Echo ≈.a
  4394.  
  4395.   Echoes the names of all files in the current directory that end with
  4396.   “.a”. (This might be useful as a precaution before executing another
  4397.   command with the argument “≈.a”.)
  4398.  
  4399.   Echo -n > EmptyFile
  4400.  
  4401.   If EmptyFile exists, this command deletes its contents; if the file
  4402.   doesn’t exist, it is created.
  4403.  
  4404.  
  4405.                              See also 
  4406.  
  4407.   Parameters and Quote commands.
  4408.  
  4409. æKY Eject
  4410. æC                       Eject -- eject volumes
  4411.  
  4412. Eject [-m] volume…
  4413.  -m                      # leave the volume mounted
  4414.  
  4415. Status codes returned:
  4416.   0    The disk was successfully ejected.
  4417.   1    Syntax error.
  4418.   2    An error occurred.
  4419.  
  4420.                            Description
  4421.  
  4422.   Flushes the volume, unmounts it, and then ejects it, if it is a 3.5-inch
  4423.   disk. A volume name must end with a colon ( : ). If volume is a number
  4424.   without a colon, it’s interpreted as a drive number.
  4425.  
  4426.     • Note: If you unmount the current volume (the volume containing
  4427.     the current directory), the boot volume becomes the current volume.
  4428.     You can keep the volume mounted with the -m option. (See the
  4429.     chapter “File Manager” of Inside Macintosh.)
  4430.  
  4431.  
  4432.                              Examples
  4433.  
  4434.   Eject Memos:
  4435.  
  4436.   Ejects (and unmounts) the disk titled Memos.
  4437.  
  4438.   Eject 1
  4439.  
  4440.   Ejects and unmounts the disk in drive 1 (the internal drive).
  4441.  
  4442.  
  4443.                              See also 
  4444.  
  4445.   Mount, Unmount, and Volumes commands.
  4446.  
  4447. æKY Entab
  4448. æC                Entab -- convert runs of spaces to tabs
  4449.  
  4450. Entab [option…] [file…]  < file > tabbed ≥ progress
  4451.  -a minValue             # Min run of blanks that can be replaced with a tab
  4452.  -d tabValue             # input tab setting
  4453.  -l quote…               # left quotes that prevent EnTab (default '")
  4454.  -n                      # no quote characters, EnTab everything
  4455.  -p                      # write progress information to diagnostics
  4456.  -q quote…               # quotes that prevent EnTab (default '")
  4457.  -r quote…               # right quotes that prevent EnTab (default '")
  4458.  -t tabValue             # output tab setting
  4459.  
  4460. Status codes returned:
  4461.   0    Normal termination.
  4462.   1    Parameter or option error.
  4463.  
  4464.                            Description
  4465.  
  4466.   Copies the specified text files to standard output, replacing runs
  4467.   of spaces with tabs. The default behavior of Entab is to do the following:
  4468.  
  4469.   1. Detab the input file, using the file’s tab setting (a resource
  4470.   saved with the file by the Shell editor), or 4 if there is none.
  4471.   You can override this “detab” value with the -d option.
  4472.  
  4473.   2. Entab the file, setting tab stops every 4 spaces. You can specify
  4474.   another tab setting with the -t option. The entabbed output file
  4475.   looks the same as the original file(s), but contains fewer characters.
  4476.  
  4477.   Options are also provided for controlling the processing of blanks
  4478.   between quoted strings.
  4479.  
  4480.  
  4481.                              Examples
  4482.  
  4483.   Entab -t 2 Example.p > CleanExample.p
  4484.  
  4485.   Detabs the file Example.p (using the file’s default tab setting),
  4486.   re-entabs it with a tab setting of 2, and writes the resulting output
  4487.   to CleanExample.p.
  4488.  
  4489.   Warning Beware of command formats such as
  4490.  
  4491.   Entab Foo > Foo
  4492.  
  4493.   Limitations Entab does not take into account embedded formatting
  4494.   characters other than tab characters. Thus backspace characters may
  4495.   cause incorrect results.
  4496.  
  4497.   The maximum width for an input line is 255 characters.
  4498.  
  4499.  
  4500.                              See also 
  4501.  
  4502.   Format command.
  4503.  
  4504. æKY Equal
  4505. æC                Equal -- compare files and directories
  4506.  
  4507. Equal [-d | -r] [-i] [-p] [-q] name… target  > differences ≥ progress
  4508.    -d                      # compare data forks only
  4509.    -r                      # compare resource forks only
  4510.    -i                      # ignore files in target not in directory name
  4511.    -p                      # write progress information to diagnostics
  4512.    -q                      # quiet - don't write output, just set {Status}
  4513.  
  4514. Status codes returned:
  4515.   0    Identical files.
  4516.   1    Syntax error.
  4517.   2    Inaccessible or missing parameter.
  4518.   3    Files not equal.
  4519.  
  4520.                            Description
  4521.  
  4522.   Compares name to targetName. By default, Equal makes no comment if
  4523.   files are the same; if they differ, it announces the byte at which
  4524.   the difference occurred. When comparing directories, the default
  4525.   condition is to report all differences, including files not found—the
  4526.   -i option ignores files in targetName that are not present in name.
  4527.  
  4528.   If targetName is a file, every name must also be a file. The specified
  4529.   files are compared with targetName.
  4530.  
  4531.   If targetName is a directory and name is a file, Equal checks in
  4532.   targetName for the file name and compares the two files. That is,
  4533.   the command
  4534.  
  4535.   Equal File1 Dir1
  4536.  
  4537.   compares File1 with :Dir1:File1.
  4538.  
  4539.   If more than one name is specified, Equal compares each name with
  4540.   the corresponding file or directory in targetName. All subdirectories
  4541.   are also compared. For example,
  4542.  
  4543.   Equal File1 Dir1 Dir2
  4544.  
  4545.   If targetName is a directory, name is a directory, and only one name
  4546.   is specified, the Equal command directly compares the two directories.
  4547.   That is, the command
  4548.  
  4549.   Equal Dir1 Dir2
  4550.  
  4551.   compares Dir1 (and all subdirectories) with Dir2.
  4552.  
  4553.  
  4554.                              Examples
  4555.  
  4556.   Equal File1 File1Backup
  4557.  
  4558.   Reports if the files are different and at what point they differ,
  4559.   in a message
  4560.  
  4561.   such as
  4562.  
  4563.   File1 File1Backup differ in data fork, at byte 5
  4564.  
  4565.   Equal -i HD:Dir1 Disk1:Dir1
  4566.  
  4567.   Compares all files and directories in HD:Dir1 with files and directories
  4568.   with the same names found in Disk1:Dir1, and reports any differences.
  4569.   This command does not report files in Disk1:Dir1 that aren’t found
  4570.   in HD:Dir1.
  4571.  
  4572.   Equal -i -d Backup: HD:Source
  4573.  
  4574.   Compares the data forks of all files on the volume Backup: with all
  4575.   those of the same name in the directory HD:Source.
  4576.  
  4577.   Equal -p Old:≈.c HD:Source
  4578.  
  4579.   Compares all files on Old: ending in “.c” with their counterparts
  4580.   in HD:Source. Prints progress information as the comparison proceeds.
  4581.  
  4582.  
  4583.                              See also 
  4584.  
  4585.   Compare command.
  4586.  
  4587. æKY Erase
  4588. æC                     Erase -- initialize volumes
  4589.  
  4590. Erase [-y] [-s] volume…
  4591.  -y                      # yes - erase the disk (avoids dialog)
  4592.  -s                      # single-sided - 400K (default 800K)
  4593.  
  4594. Status codes returned:
  4595.   0    Successful initialization.
  4596.   1    Syntax error.
  4597.   2    No such volume, or boot volume.
  4598.   3    Errors during the initialization procedure.
  4599.  
  4600.                            Description
  4601.  
  4602.   Initializes the specified volumes— the previous contents are destroyed.
  4603.   A volume name must end with a colon ( : ). If volume is a number
  4604.   without a colon, it’s interpreted as a disk drive number.
  4605.  
  4606.   A dialog box requests confirmation before proceeding with the command,
  4607.   unless the -y option is specified. The -y option can be used in scripts
  4608.   to avoid this interaction.
  4609.  
  4610.  
  4611.                              Examples
  4612.  
  4613.   Erase Reports:
  4614.  
  4615.   Initializes the volume entitled Reports.
  4616.  
  4617.   Erase 1
  4618.  
  4619.   Initializes the volume in drive 1 (the internal drive). The disk
  4620.   will be formatted as a 400K disk if drive 1 is a 400K drive, or as
  4621.   an 800K disk if drive 1 is an 800K drive.
  4622.  
  4623. æKY Evaluate
  4624. æC                  Evaluate -- evaluate an expression
  4625.  
  4626. Evaluate [-h | -o | -b] [word…]  > value
  4627. Evaluate Name [binary operator]= expression
  4628.   -h                      # display result in hexadecimal (leading 0x)
  4629.   -o                      # display result in octal (leading 0)
  4630.   -b                      # display result in binary (leading 0b)
  4631.  
  4632. Status codes returned:
  4633.   0    Valid expression.
  4634.   1    Invalid expression.
  4635.  
  4636.                            Description
  4637.  
  4638.   The list of words is taken as an expression. After evaluation, the
  4639.   result is written to standard output. Missing or null parameters
  4640.   are taken as zero. You should quote string operands that contain
  4641.   blanks or any of the characters listed in the table that follows.
  4642.  
  4643.   The operators and precedence are mostly those of the C language;
  4644.   descriptions follow.
  4645.  
  4646.   The second form of the Evaluate command evaluates the list of words
  4647.   and assigns the result to the variable name. The result of the expression
  4648.   is not written to standard output in this case. C style operations
  4649.   of the form “+=”, “-=”, and so on, are supported. If name is undefined
  4650.   at the time of execution, it is interpreted as zero.
  4651.  
  4652.   Different radices can be used in the input expression, and the result
  4653.   can be output in a different radix by using the -h, -o, or -b option.
  4654.   The default radix is decimal.
  4655.  
  4656.   Expressions: An expression can include any of the following operators.
  4657.   (In some cases, two or three different symbols can be used for the
  4658.   same operation.) The operators are listed in order of precedence;
  4659.   within each group, operators have the same precedence.
  4660.  
  4661.   Operator           Operation
  4662.  
  4663.   1. (expr)          Parentheses are used to group expressions
  4664.  
  4665.   2.  -              Unary negation
  4666.  
  4667.       ~              Bitwise negation
  4668.  
  4669.       !              NOT ¬ Logical NOT
  4670.  
  4671.   3.  *              Multiplication
  4672.  
  4673.       ÷              DIV Division
  4674.  
  4675.      %               MOD Modulus division
  4676.  
  4677.   4. +               Addition
  4678.  
  4679.      -               Subtraction
  4680.  
  4681.   5. <<              Shift left
  4682.  
  4683.      >>              Shift right
  4684.  
  4685.   6. <               Less than
  4686.  
  4687.      <= ≤            Less than or equal to
  4688.  
  4689.      >               Greater than
  4690.  
  4691.      >= ≥            Greater than or equal to
  4692.  
  4693.   7. ==              Equal
  4694.  
  4695.      != <> ≠         Not equal
  4696.  
  4697.      =~              Equal—regular expression
  4698.  
  4699.      !~              Not equal—regular expression
  4700.  
  4701.   8. &               Bitwise AND
  4702.  
  4703.   9. ^               Bitwise XOR
  4704.  
  4705.   10. |              Bitwise OR
  4706.  
  4707.   11. && AND         Logical AND
  4708.  
  4709.   12. || OR          Logical OR
  4710.  
  4711.   All operators group from left to right. Parentheses can be used to
  4712.   override the operator precedence. Null or missing operands are interpreted
  4713.   as zero. The result of an expression is always a string representing
  4714.   a number in the specified radix (the default is decimal).
  4715.  
  4716.   The logical operators !, NOT, ¬, &&, AND, | |, and OR interpret null
  4717.   and zero operands as false, and nonzero operands as true. Relational
  4718.   operators return the value 1 when the relation is true, and the value
  4719.   0 when the relation is false.
  4720.  
  4721.   The string operators ==, !=, =~, and !~ compare their operands as
  4722.   strings. All others operate on numbers. Numbers may be decimal, hexadecimal,
  4723.   octal, or binary integers representable by a 32-bit signed value.
  4724.   Hexadecimal numbers begin with either $ or 0x. Octal numbers begin
  4725.   with a 0 (zero). Binary numbers begin with 0b. Every expression is
  4726.   computed as a 32-bit signed value. Overflows are ignored.
  4727.  
  4728.   Input Radices
  4729.  
  4730.   Decimal number [0–9]
  4731.  
  4732.   Hexadecimal number 0x[0–9A–F]
  4733.  
  4734.   Octal number 0[0–7]
  4735.  
  4736.   Binary number 0b[01]
  4737.  
  4738.   The pattern-matching operators =~ and !~ are like == and != except
  4739.   that the right side is a regular expression that is matched against
  4740.   the left operand. Regular expressions must be enclosed within the
  4741.   regular expression delimiters /…/. Regular expressions are summarized
  4742.   in Appendix B.
  4743.  
  4744.     • Note: There is one difference between using regular expressions
  4745.     after =~ and !~ and using them in editing commands. When evaluating
  4746.     an expression that contains the tagging operator, ®, the Shell
  4747.     creates variables of the form {®n}, containing the matched substrings
  4748.     for each ® operator. (See the examples that follow.)
  4749.  
  4750.   Filename generation, conditional execution, pipe specifications,
  4751.   and input/output specifications are disabled within expressions,
  4752.   to allow the use of many special characters that would otherwise
  4753.   have to be quoted.
  4754.  
  4755.   Expressions are also used in the If, Else, Break, Continue, and Exit
  4756.   commands.
  4757.  
  4758.  
  4759.                              Examples
  4760.  
  4761.   Evaluate (1+2) * (3+4)
  4762.  
  4763.   Does the computation and writes the result to standard output.
  4764.  
  4765.   Evaluate -h 8 + 8
  4766.  
  4767.   Does the computation and writes the result to standard output in
  4768.   hexadecimal (0x10).
  4769.  
  4770.   Evaluate 0xA + 6
  4771.  
  4772.   Writes the result 16 to standard output. (The default output radix
  4773.   is decimal. Use -h for hexadecimal.)
  4774.  
  4775.   Evaluate lines += 1
  4776.  
  4777.   The Evaluate command increments the value of the Shell variable {lines}
  4778.   by 1. If {lines} was undefined before executing the command, {lines}
  4779.   would be 1 after execution.
  4780.  
  4781.   ( Evaluate “{aPathname}” =~ /(([¬:]+:)*)®1≈/ ) > Dev:Null
  4782.  
  4783.   Echo {®1}
  4784.  
  4785.   These commands examine a pathname contained in the variable {aPathname}
  4786.   and return the directory prefix portion of the name. In this case,
  4787.   Evaluate is used for its side effect of enabling regular expression
  4788.   processing of a filename pattern. The right side of the expression
  4789.   ( /(([¬:]+:)*)®1≈/ ) is a regular expression that matches everything
  4790.   in a pathname up to the last colon and remembers it as the Shell
  4791.   variable {®1}. Evaluate’s actual output is not of interest, so it’s
  4792.   redirected to the bit bucket, Dev:Null. (See “Pseudo-Filenames” in
  4793.   Chapter 5.) Note that the use of I/O redirection means that the Evaluate
  4794.   command must be enclosed in parentheses so that the output redirection
  4795.   symbol, >, is not taken as an expression operator.
  4796.  
  4797.   This is a complex but useful example of implementing a “substring”
  4798.   function. For a similar example, see the Rename command.
  4799.  
  4800.  
  4801.                              See also 
  4802.  
  4803.   “Structured Commands” in Chapter 5.
  4804.  
  4805.   “Pattern Matching (Using Regular Expressions)” in Chapter 6, and
  4806.   Appendix B.
  4807.  
  4808. æKY Execute
  4809. æC         Execute -- execute command file in the current scope
  4810.  
  4811. Execute commandFile
  4812.  
  4813. Execute returns the status returned by script.
  4814.  
  4815.                            Description
  4816.  
  4817.   Executes the script as if its contents appeared in place of the Execute
  4818.   command. This means that variable definitions, exports, and aliases
  4819.   in the script will continue to exist after it has finished executing.
  4820.   (Normally these definitions, exports, and aliases would be local
  4821.   to the script.) Any parameters following script are ignored. Any
  4822.   parameters to the enclosing script are available within script.
  4823.  
  4824.     • Note: If script is not a command file (that is, if it’s a built-in
  4825.     command, tool, or application), the command is run as if the
  4826.     word Execute did not appear. Parameters are passed to the command
  4827.     as usual.
  4828.  
  4829.  
  4830.                              Examples
  4831.  
  4832.   Execute {ShellDirectory}Startup
  4833.  
  4834.   Executes the Startup (and UserStartup) scripts. This command is useful
  4835.   for testing any changes you’ve made to the Startup-UserStartup script.
  4836.   Variable definitions, exports, and aliases set in Startup and UserStartup
  4837.   will be available after Startup is done executing.
  4838.  
  4839.  
  4840.                              See also 
  4841.  
  4842.   “Defining and Redefining Variables” in Chapter 5.
  4843.  
  4844.   “The Startup and UserStartup Files” in Chapter 5.
  4845.  
  4846. æKY Exists
  4847. æC        Exists -- confirm the existence of a file or directory
  4848.  
  4849. Exists [-d | -f | -w] [-q] name…  > file
  4850.   -d                      # check if name is a directory
  4851.   -f                      # check if name is a file
  4852.   -w                      # check if name is a file and writeable
  4853.   -q                      # don't quote file names with special characters
  4854.  
  4855. Status codes returned:
  4856.   0    No error.
  4857.   1    Syntax error.
  4858.   2    Other error.
  4859.  
  4860.                            Description
  4861.  
  4862.   Determines the existence of the file or directory name. The options
  4863.   help you to distinguish between directories and files and different
  4864.   access permissions. The nonexistence of name is not considered an
  4865.   error (status remains zero).
  4866.  
  4867.  
  4868.                              Examples
  4869.  
  4870.   If Not “`Exists -d HD:dir`”
  4871.     NewFolder HD:dir
  4872.   End
  4873.   Duplicate ≈.c HD:dir
  4874.  
  4875.   This example creates a new directory and copies all files ending
  4876.   with “.c” in the current directory to this new directory.
  4877.  
  4878.  
  4879.                              See also 
  4880.  
  4881.   Newer command.
  4882.  
  4883. æKY Exit
  4884. æC                   Exit -- exit from a command file
  4885.  
  4886. Exit [status] [If expression]
  4887.  
  4888. If status is present, it is returned as the status value of the 
  4889. script. If the expression is invalid, –5 is returned. Otherwise, the status 
  4890. of the last command executed is returned. 
  4891.  
  4892.                            Description
  4893.  
  4894.   If the expression is nonzero (that is, true), Exit terminates execution
  4895.   of the script in which it appears. When used interactively, Exit
  4896.   terminates execution of previously entered commands. Status is a
  4897.   number; if present, it is returned as the status value of the script.
  4898.   Otherwise, the status of the previous command is returned. If the
  4899.   “If expression” is omitted, the Exit is unconditional. (For a definition
  4900.   of expression, refer to the description of the Evaluate command.)
  4901.  
  4902.  
  4903.                              Examples
  4904.  
  4905.   Exit {ExitStatus}
  4906.  
  4907.   As the last line of a script, this Exit command would return as a
  4908.   status value whatever value had previously been assigned to {ExitStatus}.
  4909.  
  4910.  
  4911.                              See also 
  4912.  
  4913.   Evaluate command (for information on expressions).
  4914.  
  4915.   “Structured Commands” in Chapter 5.
  4916.  
  4917.   {Exit} and {Status} variables, in “Variables,” Chapter 5.
  4918.  
  4919. æKY Export
  4920. æC            Export -- make variables available to commands
  4921.  
  4922. Export [-r | -s | name…]  > exports
  4923.  -r                      # generate Unexport commands for all exported variables
  4924.  -s                      # print the names only
  4925.  
  4926. Status codes returned:
  4927.   0    No errors.
  4928.   1    Syntax error.
  4929.  
  4930.                            Description
  4931.  
  4932.   Make the specified variables available to scripts and tools. The
  4933.   list of variables exported within a script is local to that script.
  4934.   An enclosed script or tool inherits a list of exported variables
  4935.   from the enclosing script . (See Figure 5-1 in Chapter 5 of the MPW manual
  4936.   for clarification.)
  4937.  
  4938.     • Note: You can make a variable available to all scripts and
  4939.     tools by setting and exporting it in the Startup or UserStartup
  4940.     files. (Startup acts as the enclosing script for all Shell operations.)
  4941.  
  4942.   If no names are specified, a list of exported variables is written
  4943.   to standard output. (Note that the default output of Export is in
  4944.   the form of Export commands.)
  4945.  
  4946.  
  4947.                              Examples
  4948.  
  4949.   Set AIncludes {MPW}Interfaces:AIncludes:
  4950.  
  4951.   Export AIncludes
  4952.  
  4953.   Defines the variable {AIncludes} as the pathname {MPW}Interfaces:AIncludes:
  4954.   and makes it available to scripts and programs.
  4955.  
  4956.  
  4957.                              See also 
  4958.  
  4959.   Unexport, Set, and Execute commands.
  4960.  
  4961.   “The Startup and UserStartup Files” in Chapter 5.
  4962.  
  4963.   “Exporting Variables” in Chapter 5.
  4964.  
  4965. æKY ExpressIIGS
  4966. æC       ExpressIIGS -- converts files from OMF to ExpressLoad format
  4967. ExpressIIGS [-p] loadfile [-o outputfile] ≥ progress
  4968.  loadfile        # full name of the load file you wish to convert
  4969.  -o outputfile   # specify the destination filename
  4970.  -p              # write progress to diagnostic output
  4971.  
  4972. æKY FileDiv
  4973. æC          FileDiv -- divide a file into several smaller files
  4974.  
  4975. FileDiv [option…] file [prefix]  ≥ progress
  4976.  -b              # input is a byte stream instead of lines
  4977.  -f              # split file at formfeed character
  4978.  -n splitPoint   # split file after splitPoint lines or bytes (-b)
  4979.  -p              # write progress information to diagnostics
  4980.  -s n            # set -b input buffer to n * 512 bytes
  4981.  
  4982. Status codes returned:
  4983.   0    Normal termination.
  4984.   1    Parameter or option error.
  4985.  
  4986.                            Description
  4987.  
  4988.   FileDiv is the inverse of the Catenate command. It is used to break
  4989.   a large file into several smaller pieces. The input file is divided
  4990.   into smaller files, each containing an equal number of lines determined
  4991.   by the splitpoint (default=2000). The last file contains whatever
  4992.   is left over.
  4993.  
  4994.   There is also an option (-f) for splitting a file only when a form
  4995.   feed character
  4996.  
  4997.   (ASCII $0C) occurs as the first character of a line that is beyond
  4998.   the splitpoint. This option lets you split a file at points that
  4999.   are known to be the tops of pages.
  5000.  
  5001.   Each group of splitpoint lines is written to a file with the name
  5002.   prefixNN, where NN is a number starting at 01. If the prefix is omitted,
  5003.   the input file name is used as the prefix.
  5004.  
  5005.  
  5006.                              Examples
  5007.  
  5008.   FileDiv -f -n 2500 Bigfile
  5009.  
  5010.   Splits Bigfile into files of at least 2500 lines; splits the file
  5011.   at points where there are form feed characters. The output files
  5012.   have the names BigfileNN, where NN is 01, 02, and so on.
  5013.  
  5014.   Limitation The maximum length of an input line is 255 characters.
  5015.  
  5016. æKY Files
  5017. æC                  Files -- list files and directories
  5018.  
  5019. Files [option…] [name…]  > fileList
  5020.  -c creator              # list only files with this creator
  5021.  -d                      # list only directories
  5022.  -f                      # list full pathnames
  5023.  -i                      # treat all arguments as files
  5024.  -l                      # long format (type, creator, size, dates, etc.)
  5025.  -m columns              # n column format, where n = columns
  5026.  -n                      # don't print header in long or extended format
  5027.  -o                      # omit directory headers
  5028.  -q                      # don't quote filenames with special characters
  5029.  -r                      # recursively list subdirectories
  5030.  -s                      # suppress the listing of directories
  5031.  -t type                 # list only files of this type
  5032.  -x format               # extended format with the fields specified by format
  5033.  
  5034.  Note: The following characters can specify the format
  5035.      a   Flag attributes
  5036.      b   Logical size, in bytes, of the data fork
  5037.      r   Logical size, in bytes, of the resource fork
  5038.      c   Creator of File ("Fldr" for folders)
  5039.      d   Creation date
  5040.      k   Physical size in kilobytes of both forks
  5041.      m   Modification date
  5042.      t   Type
  5043.      o   Owner (only for folders on a file server)
  5044.      g   Group (only for folders on a file server)
  5045.      p   Privileges (only for folders on a file server)
  5046.  
  5047. Status codes returned:
  5048.   0    All names were processed successfully.
  5049.   1    Syntax error.
  5050.   2    An error occurred.
  5051.  
  5052.                            Description
  5053.  
  5054.   For each disk or directory named, Files lists its contents; for each
  5055.   file named, Files writes its name and any other information requested.
  5056.   Information is written to standard output. When a directory is listed,
  5057.   all subdirectories are listed first in alphabetical order, followed
  5058.   by all files in alphabetical order. If no name is given, the current
  5059.   directory is listed.
  5060.  
  5061.  
  5062.                              Examples
  5063.  
  5064.   files -r -s -f
  5065.  
  5066.   HD:source:defs.h
  5067.   HD:source:main.c
  5068.   HD:source:backup:main.c
  5069.   HD:source:backup:defs.h
  5070.   HD:source:junk:tmpfile
  5071.  
  5072.   Recursively lists the contents of the current directory, giving full
  5073.   pathnames and suppressing the printing of directory names.
  5074.  
  5075.   files -d
  5076.  
  5077.   :backup:
  5078.   :junk:
  5079.  
  5080.   Lists only the directories in the current directory.
  5081.  
  5082.   Files -i -x kd {AIncludes}
  5083.  
  5084.   Name                         Size    Creation-Date
  5085.   --------------------------- ------ ----------------
  5086.   HD:MPW:Interfaces:AIncludes: 365K   8/25/87 5:32 AM
  5087.  
  5088.   Lists the size and creation date of the {AIncludes} directory. Notice
  5089.   how the -i option is used to avoid printing the contents of the directory.
  5090.  
  5091.   files -m 2
  5092.  
  5093.   :backup: deFs.h
  5094.   :junk: main.c
  5095.  
  5096.   This is the two-column format. Notice the order of the files.
  5097.  
  5098. æKY Find
  5099. æC                Find -- find and select a text pattern
  5100.  
  5101. Find [-c count] selection [window]
  5102.  -c count                # find the nth selection, where n = count
  5103.  
  5104. Status codes returned:
  5105.   0    At least one instance of the selection was found.
  5106.   1    Syntax error.
  5107.   2    Any other error.
  5108.  
  5109.                            Description
  5110.  
  5111.   Creates a selection in window. If no window is specified, the target
  5112.   window (the second window from the front) is assumed. It’s an error
  5113.   to specify a window that doesn’t exist.
  5114.  
  5115.   Selection is a selection as defined in Chapter 6 and in Appendix B of the
  5116.   MPW manual.
  5117.  
  5118.     • Note: Searches do not necessarily start at the beginning of
  5119.     a window. A forward search begins at the end of the current selection
  5120.     and continues to the end of the document. A backward search begins
  5121.     at the start of the current selection and continues to the beginning
  5122.     of the document.
  5123.  
  5124.   All searches are not case sensitive by default. You can specify case-sensitive
  5125.   searches by first setting the Shell variable {CaseSensitive} to a
  5126.   nonzero value. (Or, you can automatically set {CaseSensitive} by
  5127.   checking Case Sensitive in the dialog boxes displayed by the Find
  5128.   and Replace menu items.)
  5129.  
  5130.  
  5131.                              Examples
  5132.  
  5133.   Find •
  5134.  
  5135.   Positions the insertion point at the beginning of the target window.
  5136.  
  5137.   Find -c 5 /procedure/ Sample.p
  5138.  
  5139.   Selects the fifth occurrence of “procedure” in the window Sample.p.
  5140.  
  5141.   Find 332
  5142.  
  5143.   Selects line 332 in the target window.
  5144.  
  5145.  
  5146.                              See also 
  5147.  
  5148.   “Selections” and “Pattern Matching” in Chapter 6, and Appendix B.
  5149.  
  5150.   “Find Menu” in Chapter 3.
  5151.  
  5152. æKY Flush
  5153. æC          Flush -- flush the tools that the Shell has cached
  5154.  
  5155. Flush
  5156. \.
  5157. Status codes returned:
  5158.   0    No errors always returned.
  5159.  
  5160.                            Description
  5161.  
  5162.   Flush clears the MPW Shell's tool cache.
  5163.  
  5164.   The MPW Shell keeps the most recently used tools in memory so that
  5165.   execution can be faster. However, there are times when you don’t
  5166.   want the tools to be in the cache. For example, you cannot run a
  5167.   tool, and then switch to the Finder and delete the file. The Finder
  5168.   will report that the tool is busy. You might also want to flush the
  5169.   cache is when you are running benchmarks or timing tool performance.
  5170.  
  5171.  
  5172.                              Examples
  5173.  
  5174.   Flush
  5175.  
  5176.   Flush the current cache. This will free all tools in the cache.
  5177.  
  5178. æKY For
  5179. æC                  For -- repeat commands once per parameter
  5180.  
  5181. For name In word…
  5182.  command…
  5183. End
  5184.  
  5185. Status codes returned:
  5186.   0    The list of words or list of commands was empty.
  5187.   –3   There was an error in the parameters to For.
  5188.  
  5189.                            Description
  5190.  
  5191.   Executes the list of commands once for each word from the “In word…”
  5192.   list. The current word is assigned to variable name, and you can
  5193.   therefore reference it in the list of commands by using the notation
  5194.   {name}. You must end each line with either a return character (as
  5195.   shown above) or with a semicolon (;).
  5196.  
  5197.   The Break command can be used to terminate the loop. The Continue
  5198.   command can be used to terminate the current iteration of the loop.
  5199.  
  5200.   The pipe specification (|), conditional command terminators (&& and
  5201.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, and ∑∑)
  5202.   may appear following the End; they apply to all of the commands in
  5203.   the list.
  5204.  
  5205.  
  5206.                              Examples
  5207.  
  5208.   For i In 1 2 3
  5209.     Echo i = {i}
  5210.   End
  5211.  
  5212.   Returns the following:
  5213.  
  5214.   i = 1
  5215.   i = 2
  5216.   i = 3
  5217.  
  5218.   For File In ≈.c
  5219.     C {File} ; Echo {File} compiled.
  5220.   End
  5221.  
  5222.   This example compiles every file in the current directory whose name
  5223.   ends with the suffix “.c”. The Shell first expands the filename pattern
  5224.   ≈.c, creating a list of the filenames after the “In” word. The enclosed
  5225.   commands are then executed once for each name in the list. Each time
  5226.   the loop is executed, the variable {File} represents the current
  5227.   word in the list. {File} is quoted because a filename could contain
  5228.   spaces or other special characters.
  5229.  
  5230.   For file in Startup UserStartup Suspend Resume Quit
  5231.     Entab {file} > temp
  5232.     Rename -y temp {file}
  5233.     Print -h {file}
  5234.     Echo {file}
  5235.   End
  5236.  
  5237.   This example entabs (replaces multiple spaces with tabs) the five
  5238.   files listed, prints them with headings, and echoes the name of each
  5239.   file after printing is complete. You might want to use this set of
  5240.   commands before making copies of the files to give to a friend. Entabbing
  5241.   the files saves considerable disk space, and printing them gives
  5242.   you some quick documentation to go with the files.
  5243.  
  5244.  
  5245.                              See also 
  5246.  
  5247.   Loop, Break, and Continue commands.
  5248.  
  5249.   “Structured Commands” in Chapter 5.
  5250.  
  5251. æKY Format
  5252. æC        Format -- set or display formatting options for a window
  5253.  
  5254. Format [[-f font] [-s fontsize] [-t tabsize] [-a attr]] | [-x fmt] [window…]
  5255.  -f fontName             # set font to fontName
  5256.  -s fontSize             # set the font size to fontSize
  5257.  -t tabSize              # set the tab size to tabSize
  5258.  -a attr                 # set the auto indent and show invisibles flags
  5259.  -x fmt                  # output the current format in the specified format
  5260.  
  5261.  Note: The following attributes may be used with the -a option:
  5262.      A   auto indentation on
  5263.      a   auto indentation off
  5264.      I   show invisibles on
  5265.      i   show invisibles off
  5266.                     L   lock auto scrolling
  5267.                     l   unlock auto scrolling
  5268.  
  5269.  Note: The following characters may be used with the -x option:
  5270.      f   font name
  5271.      s   font size
  5272.      t   tab size
  5273.      a   attributes
  5274.  
  5275. Status codes returned:
  5276.   0    No errors.
  5277.   1    Syntax error (error in parameters).
  5278.   2    All other errors.
  5279.  
  5280.                            Description
  5281.  
  5282.   This is a scriptable form of the Format menu command in the Edit
  5283.   menu. Use it to set the format of a specified list of windows. If
  5284.   no window is specified, the command operates on the target window.
  5285.   If no options are specified (other than -x), the current format settings
  5286.   are written to standard output.
  5287.  
  5288.     • Note: The Format command (and the Format menu command) modify
  5289.     the format of an existing window. The format related variables
  5290.     such as {Tab} and {Font} are used to initialize the format of
  5291.     a new window.
  5292.  
  5293.  
  5294.                              Examples
  5295.  
  5296.   Format -f Monaco -t 8 -a A {target}
  5297.  
  5298.   Sets the font, tab size, and auto-indent in the target window. The
  5299.   font size and invisible settings are not changed.
  5300.  
  5301.   Format -s 12 MyWindow
  5302.  
  5303.   Changes the font size in MyWindow to 12 point.
  5304.  
  5305.   Format {Target}
  5306.  
  5307.   A format statement with no options displays the current format of
  5308.   the window, such as the following:
  5309.  
  5310.   Format -f Monaco -s 9 -t 8 -a Ai
  5311.  
  5312.   You can then select and execute this output format.
  5313.  
  5314.   Format -x tsf
  5315.  
  5316.   4 9 Monaco
  5317.  
  5318.   Displays only the values of the specified options. Use this option
  5319.   for easily retrieving one or two values and assigning them to Shell
  5320.   variables for later use.
  5321.  
  5322.  
  5323.                              See also 
  5324.  
  5325.   The “Edit Menu,” in Chapter 3.
  5326.  
  5327.   “Variables” in Chapter 5.
  5328.  
  5329. æKY Get
  5330. æC             Get -- get a record from an indexed file
  5331.  
  5332. Get (dataFile… | -dfl listfFle) [-k key] [-width w] [-d default key] [-h | -h2] 
  5333.     [-l] [-m] [-nf] [-q] [-s] [-search] [-t] [-sfl] [-y] [-field field list 
  5334.     [-format format string] ] [-lessFields field list]
  5335.  
  5336.  
  5337.     dataFile                # A specially formatted help file which must be 
  5338.                                           accompanied by an index file whose name is of 
  5339.                                                                                                                         the form: dataFile.index, and and whose type is 'btre'
  5340.  
  5341.  
  5342.     -dfl listFile           # listFile contains a list of datafiles
  5343.     -k keyword              # keyword in the datafile's index file
  5344.     -width w                # column format for key lists, w = 1..200 is the 
  5345.                             # window width in characters
  5346.     -d default              # use default keyword if no keyword is specified
  5347.     -h                      # write full header
  5348.     -h2                     # write short header (only the used datafile)
  5349.     -l                      # list all keys in the first data file that begin
  5350.                             # with nnn, where nnn is the keyword following -k
  5351.              -lessFields tag [,tag]… # remove the named items from the existing field list 
  5352.                                         # (default list or as specified by -field)
  5353.                 -m                      # Select the keyword that was found and assign a marker to the selection
  5354.                 -nf                     # no filtering; include field tags
  5355.     -q                      # quiet output when keyword not found
  5356.     -s                      # use the selection in the active window as keyword
  5357.     -search                 # text search datafile for occurrences of keyword
  5358.     -t                      # write out template of the requested function/procedure
  5359.     -field tag[,tag]…       # specify the data field(s) to display
  5360.     -format format_string   # specify string(s) to be output in front of data
  5361.                             # specified in -field option.  '%s' flags in string 
  5362.                             # correspond ordinally to tags in -field option
  5363.     -sfl                    # produce ordered list of data files 
  5364.                             # (requires -dfl listFile)
  5365.     -y                      # do not present dialog before (re)building index file
  5366.  
  5367. Status codes returned:  
  5368.   0    The search was successful
  5369.   1    There was a syntax error
  5370.   2    There was an error in processing
  5371.         3    There was a system or out of memory error
  5372.   4    The key was not found.
  5373.  -9    The user aborted the program
  5374.     
  5375.                            Description
  5376.  
  5377.   Get searches the btree file dataFile.index looking for the key word
  5378.   key. If found, Get will return data associated with the key word from 
  5379.   the file dataFile.  The data may be formatted by columns.
  5380.  
  5381. æKY GetErrorText
  5382. æC     GetErrorText -- display error messages based on message number
  5383.  
  5384. GetErrorText [-f filename] [-s filename] [-n] [-p] errnbr[,insert,…] …
  5385. GetErrorText -i idnbr,…
  5386.  # display error messages based on message number
  5387.  
  5388.  -f filename             # explicit error msg file
  5389.  -i idnbr                # report meaning of System Error Handler ID number
  5390.  -n                      # suppress error numbers in displayed messages
  5391.  -p                      # write SysErrs's version info to diagnostics
  5392.  -s filename             # explicit system error msg file (default SysErrs.Err)
  5393.  
  5394. Status codes returned:
  5395.   0    Normal termination.
  5396.   1    Parameter or option error.
  5397.  
  5398.                            Description
  5399.  
  5400.   Displays the error messages corresponding to a set of specified error
  5401.   numbers or ID numbers. By default, GetErrorText assumes that the
  5402.   error numbers correspond to Macintosh Operating System error numbers.
  5403.   The file SysErrs.Err is a special file used by MPW tools to determine
  5404.   the error messages corresponding to system error numbers. Other system
  5405.   error message files may be specified by using the -s option.
  5406.  
  5407.   In addition to system errors, some tools have their own error message
  5408.   files. For example, the assembler's error message file is in the
  5409.   data resource fork of Asm itself. For such tools, you can display
  5410.   the error messages corresponding to tool error numbers by specifying
  5411.   the -f option. In this case, you can specify sample inserts, along
  5412.   with the error numbers, for error messages that take inserts, as
  5413.   shown above.
  5414.  
  5415.   GetErrorText can also display the meanings of the ID numbers reported
  5416.   by the System Error Handler in alert dialog boxes. The -i option
  5417.   is used for this purpose.
  5418.  
  5419.  
  5420.                              Examples
  5421.  
  5422.   GetErrorText -43 -44 -45
  5423.  
  5424.   Displays the error messages corresponding to system errors -43, -44,
  5425.   and -45.
  5426.  
  5427.   GetErrorText -i 28 2
  5428.  
  5429.   Displays the error messages corresponding to system ID numbers 28
  5430.   and 2.
  5431.  
  5432. æKY GetFileName
  5433. æC          GetFileName -- display a Standard File dialog box
  5434.  
  5435. GetFileName [-q] [-s] 
  5436.             [-c | [[-t TYPE]… | -p | -d | -wd] [-m message] [-b buttontitle] [pathname]]
  5437.     -b buttontitle          # specify the default button's title
  5438.     -c                      # write current standard file path to standard output
  5439.     -d                      # select a directory
  5440.     -wd                     # select a directory on a non-locked volume
  5441.     -m message              # specify a prompt
  5442.     -p                      # select a new filename (SFPutFile) 
  5443.     -q                      # suppress quoting of filenames
  5444.     -s                      # return 0 status even if cancel is clicked
  5445.     -t type                 # specify file type for SFGetFile dialog
  5446.  
  5447. Status codes returned:
  5448.   0    User specified a file and no errors occurred.
  5449.   1    Parameter or option error.
  5450.   2    System error.
  5451.   4    User canceled the standard file dialog box.
  5452.  
  5453.                            Description
  5454.  
  5455.   GetFileName displays a standard file dialog box. Either SFPutFile
  5456.   or SFGetFile is called, and the returned filename or pathname is
  5457.   written to standard output. The standard file starting directory
  5458.   is set to pathname if specified. If pathname includes a local filename
  5459.   and if SFPutFile is called, the local filename is used as the default
  5460.   filename. See the examples.
  5461.  
  5462.  
  5463.                              Examples
  5464.  
  5465.   Open `GetFileName -t TEXT {pinterfaces}`
  5466.  
  5467.   Opens the text file in directory {pinterfaces} chosen in SFGetFile
  5468.   by the user.
  5469.  
  5470.   GetFileName -p HD:MPW:StartUp
  5471.  
  5472.   An SFPutFile dialog box is displayed with the directory set to HD:MPW:
  5473.   and StartUp is displayed in the textedit field of the dialog box.
  5474.  
  5475.   Limitation The resulting filename cannot be longer than 255 characters.
  5476.  
  5477.  
  5478.                              See also 
  5479.  
  5480.   “The Standard File Package,” Inside Macintosh, Volume I.
  5481.  
  5482. æKY GetListItem
  5483. æC      GetListItem -- display items for selection in a dialog box
  5484.  
  5485. GetListItem [option…] [[item…] | < file]
  5486.     -c[ancel]               # return a status of 0 even when cancel is clicked
  5487.     -d[efault] item         # item is entered in list and comes up selected
  5488.     -m[essage] message      # display message in dialog above the list
  5489.     -q[uote]                # don't quote items in the output
  5490.     -r[ows] rows            # make the list with this many rows
  5491.     -s[ingle]               # only allow a single selection
  5492.                 -sort                   # sort input list
  5493.     -w[idth] width          # make the list this many pixels wide
  5494.  
  5495. Status codes returned:
  5496.   0    No errors (or Cancel button was clicked if  -c option is used).
  5497.   1    Syntax error (bad option).
  5498.   2    Cancel button was clicked.
  5499.  
  5500.                            Description
  5501.  
  5502.   Takes the items on the command line (or, if no items are present
  5503.   on the command line, items from standard input) and lists them in
  5504.   a dialog box. Items in the list can be selected with the mouse and
  5505.   modifier keys. Selected items are written to standard output when
  5506.   the OK button is clicked.
  5507.  
  5508.  
  5509.                              Examples
  5510.  
  5511.   Print `files -t TEXT | GetListItem -m “Select files to print:”`
  5512.  
  5513.   Lists all text files in the current directory and prints those selected
  5514.   by the user, as shown below.
  5515.  
  5516. æKY Help.MPW
  5517. æC                  Help -- write summary information
  5518.  
  5519. Help [-f helpfile] [command…]  > helpInformation
  5520.  -f helpfile             # alternate helpfile (default MPW.Help)
  5521.  
  5522. Status codes returned:
  5523.   0    Information was found for the given command.
  5524.   1    Syntax error.
  5525.   2    A command could not be found.
  5526.   3    The help file could not be opened.
  5527.  
  5528. æKY If
  5529. æC                 If -- conditional command execution
  5530.  
  5531. If expression
  5532.  command…
  5533. [Else If expression
  5534.  command… ] …
  5535. [Else
  5536.  command… ]
  5537. End
  5538.  
  5539. Status codes returned:
  5540.    0    None of the lists of commands were executed.
  5541.   –1    Invalid expression.
  5542.  
  5543.                            Description
  5544.  
  5545.   Executes the list of commands following the first expression whose
  5546.   value is nonzero. (Null strings are considered zero.) At most one
  5547.   list of commands is executed. You may specify any number of “Else
  5548.   If” clauses. The final Else clause is optional. The return characters
  5549.   (as shown above) or semicolons must appear at the end of each line.
  5550.  
  5551.   The pipe specification (|), conditional command terminators (&& and
  5552.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, ∑∑) may
  5553.   appear following the End and apply to all of the commands in the
  5554.   list.
  5555.  
  5556.   For a definition of expression, see the description of the Evaluate
  5557.   command.
  5558.  
  5559.  
  5560.                              Examples
  5561.  
  5562.   If {Status} == 0
  5563.     Beep 1a,25,200
  5564.   Else
  5565.     Beep -3a,25,200
  5566.   End
  5567.  
  5568.   Produces an audible indication of the success or failure of the preceding
  5569.   command.
  5570.  
  5571.   For window in `Windows`
  5572.     If {window} != {Worksheet} AND {window} != {Active}
  5573.       Close {window}
  5574.     End
  5575.   End
  5576.  
  5577.   Closes all of the open windows except the active window and the Worksheet
  5578.   window. (Refer also to the Windows command.)
  5579.  
  5580.   The following commands, as a script, would implement a trivial case
  5581.   of a general “compile” command:
  5582.  
  5583.   If {1} =~ /≈.c/
  5584.     C {COptions} {1}
  5585.   Else If {1} =~ /≈.p/
  5586.     Pascal {POptions} {1}
  5587.   End
  5588.  
  5589.   If the above commands were saved in a file (say, as “Compile”), both
  5590.   C and Pascal programs could be compiled with the command
  5591.  
  5592.   Compile filename
  5593.  
  5594.  
  5595.                              See also 
  5596.  
  5597.   Evaluate command (for a description of expressions).
  5598.  
  5599.   “Structured Commands” in Chapter 5.
  5600.  
  5601. æKY Lib
  5602. æC           Lib -- combine object files into a library file
  5603.  
  5604. Lib [option…] objectFile…  ≥ progress
  5605.     -d                      # suppress duplicate definition warnings
  5606.     -df deleteFile          # delete modules listed in file deleteFile
  5607.     -dm name[,name]…        # delete external modules and entry points
  5608.     -dn name[,name]…        # delete external names, making them local
  5609.     -f                      # allow FORTRAN-style common data
  5610.                 -mf                     # use MultiFinder temporary memory if necessary
  5611.     -o name                 # write object file name (default Lib.Out.o)
  5612.     -p                      # write progress information to diagnostics
  5613.     -rn OldNameA=NewNameA   # change module name(s) OldNameA to NewNameA,
  5614.       [,OldNameB=NewNameB]… #   OldNameB to NewNameB, etc.
  5615.     -sg newSeg=old[,old]…   # merge old segments into new segment
  5616.     -sn oldSeg=newSeg       # change segment name oldSeg to newSeg
  5617.     -sym [On | Full]        # keep symbolic information (default)
  5618.          [Off]              # discard symbolic information, can be followed by:
  5619.             [,NoLabels]     # discard label information
  5620.             [,NoLines]      # discard source line information
  5621.             [,NoTypes]      # discard type information
  5622.             [,NoVars]       # discard variable information
  5623.     -ver N                  # set OMF file version number to N
  5624.     -w                      # suppress warnings
  5625.  
  5626. Status codes returned:
  5627.   0    No problem.
  5628.   1    Syntax error.
  5629.   2    Fatal error.
  5630.  
  5631.                            Description
  5632.  
  5633.   Combines the specified object files into a single file. Input files
  5634.   must have type 'OBJ' .
  5635.  
  5636.   Lib is used for the following:
  5637.  
  5638.     • Combining object code from different languages into a single
  5639.     file.
  5640.  
  5641.     • Combining several object files into a larger object file (a
  5642.     library).
  5643.  
  5644.     • Combining several libraries into a single library, for use
  5645.     in building a particular application or desk accessory. This
  5646.     can greatly improve the performance of the Linker.
  5647.  
  5648.     • Deleting unneeded modules (with the -dm option), changing segmentation
  5649.     (the -sg and -sn options), or changing the scope of a symbol
  5650.     from external to local (the -dn option). (These options are useful
  5651.     when you construct a specialized library for linking a particular
  5652.     program.)
  5653.  
  5654.   Object files that have been processed with Lib result in significantly
  5655.   faster links when compared with the “raw” object files produced by
  5656.   the assembler or compilers.
  5657.  
  5658.   The output of Lib is logically equivalent to the concatenation of
  5659.   the input files, except for the optional renaming, resegmentation,
  5660.   and deletion operations, and the possibility of overriding an external
  5661.   name. The resolution of external names in Lib is identical to Link—in
  5662.   fact, the two programs share the same code for reading object files.
  5663.   Although multiple symbols are reduced to a single symbol, no combining
  5664.   of modules into larger modules is performed, and no cross-module
  5665.   references are resolved. This behavior guarantees that the Linker’s
  5666.   output will be the same size whether or not the output of Lib was
  5667.   used.
  5668.  
  5669.   See “Library Construction” in Chapter 10 of the MPW manual for a detailed 
  5670.   discussion of the behavior and use of Lib.
  5671.  
  5672.  
  5673.                              Examples
  5674.  
  5675.   Lib {CLibraries}≈ -o {CLibraries}CLibrary.o
  5676.  
  5677.   Combines all of the library object files from the {CLibraries} directory
  5678.   into a single library named CLibrary.o. For applications that require
  5679.   most or all of the C library files, using the new CLibrary file will
  5680.   reduce link time.
  5681.  
  5682.  
  5683.                              See also 
  5684.  
  5685.   Link, DumpObj, and DumpCode commands.
  5686.  
  5687.   “Optimizing Your Links” and “Library Construction” in Chapter 10.
  5688.  
  5689.   Appendix H.
  5690.  
  5691. æKY Line
  5692. æC                Line -- find line in the target window
  5693.  
  5694. Line n
  5695.  
  5696. Status codes can be returned by either the Find or the Open commands 
  5697. that make up the Line script:
  5698.   0    No errors.
  5699.   1    Syntax error.
  5700.   2    No target window; other error.
  5701.   3    System error.
  5702.  
  5703.                            Description
  5704.  
  5705.   Line finds line n in the target window. The parameter n is usually
  5706.   an integer, but may be any selection expression. The target window
  5707.   becomes the active (frontmost) window.
  5708.  
  5709.   Line is a script containing these two commands:
  5710.  
  5711.   Find {1} {target} # Find line n in the target window
  5712.  
  5713.   Open {target} # Bring the target window to the top
  5714.  
  5715.  
  5716.                              Examples
  5717.  
  5718.   Line 123
  5719.  
  5720.   Finds line 123 in the target window and makes the target window the
  5721.   new active window.
  5722.  
  5723.   ### Undefined symbol: length
  5724.  
  5725.   File Count.c; Line 75
  5726.  
  5727.   The File and Line commands above are part of an error message produced
  5728.   by the MPW C compiler. The MPW Assembler and MPW Pascal compilers
  5729.   produce errors when using similar formats. You can execute such error
  5730.   messages to find the line that contains the error.
  5731.  
  5732.   The command File is defined as an alias for Target in the Startup
  5733.   file. Thus File opens the specified file as the target window. Line
  5734.   then selects the offending line in the window and brings the window
  5735.   to the front. Notice that the remainder of the error message is a
  5736.   comment.
  5737.  
  5738.  
  5739.                              See also 
  5740.  
  5741.   Find command.
  5742.  
  5743. æKY Link
  5744. æC           Link -- link an application, tool, or resource
  5745.  
  5746. Link [option…] objectFile…  > map ≥ progress
  5747.  -ac alignment           # align code modules to 'n' byte boundaries
  5748.  -ad alignment           # align data modules to 'n' byte boundaries
  5749.  -c creator              # set resourceFile creator (default ????)
  5750.  -d                      # suppress duplicate definition warnings
  5751.  -da                     # desk accessory - add NULL to segment names
  5752.  -f                      # allow FORTRAN-style common data
  5753.  -l                      # write a location map to output
  5754.  -la                     # -l, include anonymous symbols in location map
  5755.  -lf                     # -l, include file and location of definitions
  5756.  -m mainEntry            # use mainEntry as main entry point
  5757.  -ma name=alias          # create an alias for module name
  5758.  -map                    # generate "friendly" link map
  5759.  -mf                     # use MultiFinder temporary memory if necessary
  5760.  -model far              # process 32-bit load-time relocatable references
  5761.  -model near             # prohibit 32-bit load-time relocatable references
  5762.  -msg keyword[,…]        # message options
  5763.      [no]dup             #   (suppress) warnings about duplicate symbols
  5764.      [no]multiple        #   (suppress) multiple undefined symbol reports
  5765.      [no]warn            #   (suppress) warning messages
  5766.  -o resourceFile         # write resourceFile (default Link.Out)
  5767.  -opt [Off]              # disable Object Pascal optimizations (default)
  5768.       [On ]              # enable optimizations
  5769.       [NoBypass]         # enable optimizations, but always dispatch
  5770.          [,Info]         #   write optimization information to diagnostics
  5771.          [,Names]        #   include MacsBug symbols within SelectorProc modules
  5772.  -p                      # write progress information to diagnostics
  5773.  -ra [seg]=attr[,attr…]  # set segment resource attributes:
  5774.      $xx (or) nnn        #   a hex or decimal attribute you figure out
  5775.      resSysHeap          #   or a comma-seperated list of resource
  5776.      resPurgeable        #    attributes by name
  5777.      resLocked           #   
  5778.      resProtected        #   
  5779.      resPreload          #   
  5780.      resChanged          #   (essentially ignored)
  5781.  -rn                     # don't include resource names in resourceFile
  5782.  -rt type[=id]           # set resource type and lowest id (default CODE=0)  
  5783.  -sg newSeg=old[,old]…   # merge old segments into new segment
  5784.  -sn oldSeg=newSeg       # change segment name oldSeg to newSeg
  5785.  -srt                    # sort global data by "near" and "far" references
  5786.  -ss size                # maximum segment size (default 32760)
  5787.  -sym [Off]              # disable symbolic output (default)
  5788.          [On | Full]     # enable symbolic output, can be followed by:
  5789.          [,NoLabels]     #    omit label information
  5790.          [,NoLines]      #    omit source line information
  5791.          [,NoTypes]      #   omit type information
  5792.          [,NoVars]       #   omit variable information
  5793.  -t type                 # set resourceFile type (default APPL)
  5794.  -uf unrefFile           # write list of unreferenced modules to unrefFile
  5795.  -w                      # suppress warnings
  5796.  -wrap                   # when jump table space is exhausted, put excess jump table 
  5797.                          #   entries in global data space, if available
  5798.  -x crossRefFile         # write cross reference to crossRefFile
  5799.  
  5800. Status codes returned:
  5801.   0    No problem.
  5802.   1    Syntax error.
  5803.   2    Fatal error.
  5804.  
  5805.                            Description
  5806.  
  5807.   Links the specified object files into an application, tool, desk
  5808.   accessory, or driver. The input object files must have type 'OBJ'.
  5809.   Linked segments from the input object files are placed in code resources
  5810.   in the resource fork of the output file. The default output filename
  5811.   is Link.Out, but you can specify other names with the -o option.
  5812.  
  5813.   For detailed information about the linker, and instructions for linking
  5814.   applications, MPW tools, and desk accessories, see Chapters 8 and
  5815.   10 of the MPW manual. The first dialog box of Link’s Commando dialog is 
  5816.   reprinted here for convenience.
  5817.  
  5818.   The linker’s default action is to link an application, placing the
  5819.   output segments into 'CODE' resources. When you link an application,
  5820.   all old 'CODE' resources are deleted before the new 'CODE' resources
  5821.   are written. By default, resources created by the linker are given
  5822.   resource names that are the same as the corresponding segment names.
  5823.   You can change a resource (segment) name with the -sn or -sg options,
  5824.   and you can create unnamed resources with the -rn option.
  5825.  
  5826.   The linker executes in four phases:
  5827.  
  5828.     • Input phase: The linker reads all input files, finds all symbolic
  5829.     references and their corresponding definitions, and constructs
  5830.     a reference graph. Duplicate references are found and warnings
  5831.     are issued.
  5832.  
  5833.     • Analysis phase: The linker allocates and relocates code and
  5834.     data, detects missing references, and builds the jump table.
  5835.     If the -l or -x option is given, Link produces a linker map or
  5836.     cross-reference listing. The linker also eliminates unused code
  5837.     and data.
  5838.  
  5839.     • Output phase: The linker copies linked code segments into code
  5840.     resources in the resource fork of the output file. By default,
  5841.     these resources are given the same names as the corresponding
  5842.     segment names. (The cursor spins backward during this phase.)
  5843.  
  5844.     • Symbolic output phase: Optionally, Link may be used to create
  5845.     the .SYM file for use with SADE.
  5846.  
  5847.  
  5848.                              Examples
  5849.  
  5850.   Link Sample.p.o ∂
  5851.   “{PLibraries}”PInterface.o ∂
  5852.   “{PLibraries}”PasLib.o ∂
  5853.   “{Libraries}”Runtime.o ∂
  5854.   -o Sample ∂
  5855.   -la >Sample.map
  5856.  
  5857.   Links the main program file Sample.p.o with the libraries PInterface.o,
  5858.   PasLib.o, and Runtime.o, placing the output in Sample and placing
  5859.   the Linker map in the file Sample.map. Sample is an application that
  5860.   can be launched from the Finder or executed from MPW.
  5861.  
  5862.   Link -rt MROM=8 -c 'MPS ' -t ZROM -ss 140000 ∂
  5863.   -l > ROMLocListing -o MyROMImage {LinkList}
  5864.  
  5865.   Links the files defined in the Shell variable {LinkList} into a ROM
  5866.   image file, placing the output in the file MyROMImage. The segment
  5867.   size is set to 140,000 bytes, and the ROM is created as a resource
  5868.   'MROM' with ID=8. The file is typed as being created by MPW (creator
  5869.   'MPS '), with file type ZROM. Link’s location-ordered listing is
  5870.   placed in the file ROMLocListing.
  5871.  
  5872.   For additional examples, see “Link” in Chapter 10 and the makefiles
  5873.   in the Examples folders for the languages you are using.
  5874.  
  5875.  
  5876.                              See also 
  5877.  
  5878.   Lib command and Appendix H, “Object File Format.”
  5879.  
  5880.   Chapter 8, “The Build Process,” and Chapter 10, “Link.”
  5881.  
  5882.   The Segment Loader and the Resource Manager chapters in Inside Macintosh.
  5883.  
  5884.   Inside Macintosh, Volume IV, for information on the 128K ROM, the
  5885.   System Folder, and the Finder.
  5886.  
  5887. æKY LinkIIGS
  5888. æC                 LinkIIGS -- the MPW IIGS Linker
  5889. LinkIIGS [option…] objectFile… >listing ≥ progress
  5890.  -a name=alias      # symbol "name" will be changed to "alias"
  5891.  -apw               # convert normally ignored APW structures
  5892.  -at $xxxx          # set the auxilliary type of the output file to "$xxxx"
  5893.  -b                 # "big" link will be performed (less memory used by Linker)
  5894.  -b2                # "bigger" link will be performed (less memory used by Linker)
  5895.  -l                 # write summary information to standard output
  5896.  -lib libFile       # search library file "libFile" for undefined references and include
  5897.  -lseg loadsegName  # retarget the following object segments to Load Segment "loadsegName"
  5898.  -o outputFile      # output file is "outputfile" 
  5899.  -org $xxxx         # starting address of absolute Load Segment is "$xxxx"
  5900.  -p                 # write progress to diagnostic output
  5901.  -path pathname     # pathname prefix to be used in Pathname Table Segment
  5902.  -r                 # set reload bit in Load Segments "~globals" and "~arrays"
  5903.  -s                 # symbol table is sorted and printed to standard output
  5904.  -stamp             # put time/date stamps in Pathname Table Segment
  5905.  -t $xx             # set the file type of the output file to "$xx"
  5906.  -w                 # warning messages are not displayed
  5907.  -w2                # warnings are treated as fatal errors
  5908.  -x                 # output Load File will not be in ExpressLoad format
  5909. æKY Loop
  5910. æC                 Loop -- repeat commands until Break
  5911.  
  5912. Loop
  5913.  command…
  5914. End
  5915.  
  5916. Loop returns the status of the last command executed.
  5917.  
  5918.                            Description
  5919.  
  5920.   Executes the enclosed commands repeatedly. The Break command is used
  5921.   to terminate the loop. The Continue command can be used to terminate
  5922.   the current iteration of the loop.
  5923.  
  5924.   The pipe specification (|), conditional command terminators (&& and
  5925.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, and ∑∑)
  5926.   may appear following the End, and apply to all of the commands in
  5927.   the list.
  5928.  
  5929.  
  5930.                              Examples
  5931.  
  5932.   The following script runs a command several times, once for each
  5933.   parameter:
  5934.  
  5935.   ### Repeat - Repeat a command for several parameters ###
  5936.  
  5937.   # Syntax:
  5938.  
  5939.   # Repeat command parameter…
  5940.  
  5941.   #
  5942.  
  5943.   # Execute command once for each parameter in the parameter
  5944.  
  5945.   # list. Options can be specified by including them with
  5946.  
  5947.   # the command name in quotes.
  5948.  
  5949.   #
  5950.  
  5951.   Set cmd {1}
  5952.  
  5953.   Loop
  5954.  
  5955.   Shift
  5956.  
  5957.   Break If {1} ==
  5958.  
  5959.   {cmd} {1}
  5960.  
  5961.   End
  5962.  
  5963.   Notice that Shift is used to step through the parameters, and that
  5964.   Break ends the loop when all parameters have been used.
  5965.  
  5966.  
  5967.                              See also 
  5968.  
  5969.   Break, For, and Continue commands.
  5970.  
  5971.   “Structured Commands” in Chapter 5.
  5972.  
  5973. æKY Make
  5974. æC             Make -- build up-to-date version of a program
  5975.  
  5976. Make [option…] target…   > commands ≥ progress
  5977.  -d name[=value]         # define variable name as value (overrides makefile)
  5978.  -e                      # rebuild everything regardless of dates
  5979.  -f makefile             # read dependencies from makefile (default MakeFile)
  5980.  -p                      # write progress information to diagnostics
  5981.  -r                      # write roots of dependency graph to output
  5982.  -s                      # write structure of target dependencies to output
  5983.  -t                      # touch dates of targets and prerequisites
  5984.  -u                      # identify targets in makefile not reached in build
  5985.  -v                      # write verbose explanations to diagnostics
  5986.  -w                      # suppress warnings
  5987.     -y                      # like -v, but omit announcing up-to-date targets
  5988.  
  5989.  
  5990. Status codes returned:
  5991.   0    Successful completion.
  5992.   1    Parameter or option error.
  5993.   2    Execution error.
  5994.  
  5995.                            Description
  5996.  
  5997.   Generates a set of Shell commands that you can execute to build up-to-date
  5998.   versions of the specified target files. (If no target is specified,
  5999.   the target on the left side of the first dependency rule in the makefile
  6000.   is built.) Make allows you to rebuild only those components of a
  6001.   program that require rebuilding. Make determines which components
  6002.   need rebuilding by reading a makefile. This is a text file that describes
  6003.   dependencies between the components of a program, along with the
  6004.   Shell commands needed to rebuild each component. You can specify
  6005.   makefiles with the -f option. After processing the makefiles, Make
  6006.   writes to standard output the appropriate set(s) of commands needed
  6007.   to rebuild the target(s).
  6008.  
  6009.   See “Format of a Makefile” in Chapter 9 of the MPW manual for a 
  6010.   description of the format of a makefile. The first dialog box of Make’s 
  6011.   Commando dialog is reproduced here for convenience.
  6012.  
  6013.   Make executes in two phases:
  6014.  
  6015.     • In the first phase, Make reads the makefile(s) and creates
  6016.     a file (target) dependency graph. (The “beachball” cursor spins
  6017.     counterclockwise during this phase.)
  6018.  
  6019.     • In the second phase, Make generates the build commands for
  6020.     the target to be built (the cursor spins clockwise). If a target
  6021.     file doesn’t exist or if it depends on files that are out-of-date
  6022.     or newer than the target, Make writes out the appropriate command
  6023.     lines for updating the target file. This process is recursive
  6024.     and “bottom up” so that commands are issued first for those lower-level
  6025.     dependencies that need to be rebuilt.
  6026.  
  6027.   You can execute the generated build commands after Make is done executing.
  6028.  
  6029.  
  6030.                              Examples
  6031.  
  6032.   Make -p -f MakeFile Sample
  6033.  
  6034.   Makes the target file Sample, and prints progress information. Sample’s
  6035.   dependency relations are described in the makefile :AExamples:MakeFile.
  6036.  
  6037.   Sample ƒƒ Sample.r
  6038.       Rez Sample.r -o Sample -a
  6039.       SetFile -a B Sample -c ASMP -t APPL #set bundle bit
  6040.  
  6041.   Sample ƒƒ Sample.r Sample.a.o
  6042.       Link Sample.a.o -o Sample
  6043.  
  6044.   Sample.a.o ƒ Sample.a
  6045.       Asm Sample.a
  6046.  
  6047.   The ƒ (Option-F) character means “is a function of”—that is, the
  6048.   file on the left side depends on the files on the right side. If
  6049.   the files on the right are newer, the subsequent Shell commands are
  6050.   written to standard output. (See Chapter 9 for details.)
  6051.  
  6052.  
  6053.                              See also 
  6054.  
  6055.   “Format of a Makefile” in Chapter 9 for the format of a makefile,
  6056.   examples, and other information about using Make.
  6057.  
  6058.   Makefiles for building sample programs are contained in the Examples
  6059.   folders:
  6060.  
  6061.     • Examples:AExamples:Makefile
  6062.  
  6063.     • Examples:PExamples:Makefile
  6064.  
  6065.     • Examples:CExamples:Makefile
  6066.  
  6067. æKY MakeBinIIGS
  6068. æC           MakeBinIIGS -- converts Load files to Binary files
  6069. MakeBinIIGS [option…] loadfile [-o binfile] >listing ≥ progress
  6070.  loadfile    # Full or partial pathname of the load file you wish to convert.
  6071.  binfile     # Full or partial pathname to be assigned to the binary file.  If
  6072.              # you omit this parameter, the load file name is used and
  6073.              # loadfile is overwritten.
  6074.  -org=val    # The binary file is given a fixed start location at val and all
  6075.              # code is relocated for execution starting at val.  You can use
  6076.              # a decimal number for val, or you can specify a hexadecimal
  6077.              # number by preceding val with a dollar sign ($).  If you omit
  6078.              # this parameter, loadfile is relocated to start at $2000.
  6079.  -p          # progress report is printed
  6080.  -s          # summary report is printed
  6081.  -t $xx      # sets the output file type to $xx
  6082.  -at $xxxx   # sets the output file auxtype to $xxxx
  6083.  
  6084. æKY MakeErrorFile
  6085. æC            MakeErrorFile -- create error message textfile
  6086.  
  6087. MakeErrorFile [option…] [file…]  < file > listing ≥ progress
  6088.  -l                      # write listing to standard output
  6089.  -o file/dir             # output file or directory
  6090.  -p                      # write progress information to diagnostics
  6091.  
  6092. Status codes returned:
  6093.   0    No errors.
  6094.   1    Syntax error.
  6095.   2    Error in processing.
  6096.  
  6097.                            Description
  6098.  
  6099.   MakeErrorFile creates specially formatted error message files used
  6100.   to retrieve the error messages associated with error numbers. The
  6101.   ErrMgr unit in the ToolLibs.o library is used by programs to access
  6102.   the error files created by MakeErrorFile. SysErrs.Err is one such
  6103.   error file; it is used by various MPW tools to get the textual messages
  6104.   associated with Macintosh system error codes. See the documentation
  6105.   on the ErrMgr unit for more information on how error files are accessed.
  6106.  
  6107.  
  6108.                              Examples
  6109.  
  6110.   MakeErrorFile SysErrs -l >SysErrsList
  6111.  
  6112.   Writes an ordered list of system error numbers and messages to the
  6113.   file SysErrsList.
  6114.  
  6115.  
  6116. æKY MakeLibIIGS
  6117. æC               MakeLibIIGS -- creates Library files
  6118. MakeLibIIGS -c -d -f -l <filename> -o <filename> -r -x  <filename>… >listing ≥ progress
  6119.  -c             # convert from version 1 OMF to version 2 OMF
  6120.  -d             # delete the file names from the library
  6121.  -f             # list library contents to stdout
  6122.  -l <filename>  # specify the source library. If not -o, also the destination
  6123.  -o <filename>  # specify the destination library.
  6124.  -r             # replace <filename>s in the specified library
  6125.  -x             # extract <filename>s from the specified library
  6126. æKY Mark
  6127. æC                Mark -- assign a marker to a selection
  6128.  
  6129. Mark [-y | -n] selection name [window]
  6130.  -y                      # replace existing marker (avoids dialog)
  6131.  -n                      # don't replace existing marker (avoids dialog)
  6132.  
  6133. Status codes returned:
  6134.   0    No errors.
  6135.   1    Syntax error.
  6136.   2    Error in processing.
  6137.   3    System error.
  6138.  
  6139.                            Description
  6140.  
  6141.   Mark assigns the marker name to the range of text specified by the
  6142.   selection in window. If no window is specified, the command operates
  6143.   on the target window (the second window from the front). The new
  6144.   marker name is included in the Mark menu when window is the current
  6145.   active window. A marker is associated with a logical, as opposed
  6146.   to absolute, range of text. The ranges of markers may overlap, but
  6147.   each marker must have a unique name. Marker names are case sensitive.
  6148.  
  6149.   A dialog box requests confirmation if the marker name conflicts with
  6150.   an existing marker name. The -y or -n option can be used in scripts
  6151.   to avoid this interaction.
  6152.  
  6153.   Deletion and insertion operations affect markers according to these
  6154.   rules:
  6155.  
  6156.     • Any editing outside the range of a marker will not affect the
  6157.     logical range of the marker, where “outside” means that the range
  6158.     of editing changes does not intersect the range of the marker.
  6159.  
  6160.     • Any editing inside the range of a marker will change the logical
  6161.     range of the marker by the amount of the editing change. For
  6162.     example, adding ten characters to the inside of a marker’s range
  6163.     will increase the range of the marker by ten characters. Another
  6164.     way to say this is that a marker has responsibility for all the
  6165.     characters added to (or deleted from) its range.
  6166.  
  6167.     • Any deletion that totally encloses a marker will delete the
  6168.     marker.
  6169.  
  6170.  
  6171.                              Examples
  6172.  
  6173.   Mark § 'Procedure 1'
  6174.  
  6175.   Assigns a marker with the name “Procedure 1” to the current selection
  6176.   in the target window.
  6177.  
  6178.   Limitation It is currently not possible to “Undo” the effects of
  6179.   any editing operations on markers.
  6180.  
  6181.  
  6182.                              See also 
  6183.  
  6184.   Unmark and Markers commands.
  6185.  
  6186.   “Mark Menu” in Chapter 3.
  6187.  
  6188.   “Markers” in Chapter 6.
  6189.  
  6190. æKY Markers
  6191. æC                        Markers -- list markers
  6192.  
  6193. Markers [-q] [window]
  6194.  -q                      # don't quote the marker names
  6195.  
  6196. Status codes returned:
  6197.   0    No errors.
  6198.   1    Syntax error.
  6199.   2    Error in processing.
  6200.   3    System error.
  6201.  
  6202.                            Description
  6203.  
  6204.   Markers prints the names of all markers associated with window. The
  6205.   names are written one per line, and they are ordered from the beginning
  6206.   to the end of the window.
  6207.  
  6208.  
  6209.                              Examples
  6210.  
  6211.   Markers {Target}
  6212.  
  6213.   Lists all markers associated with the target window.
  6214.  
  6215.  
  6216.                              See also 
  6217.  
  6218.   “Mark Menu” in Chapter 3.
  6219.  
  6220.   “Markers” in Chapter 6.
  6221.  
  6222. æKY MatchIt
  6223. æC   MatchIt -- semi-intelligent language sensitive bracket matcher
  6224.  
  6225. MatchIt [-a[sm] | -p[ascal] | -c] [-h] [-l] [-n] [-v] [window]
  6226.  -a[sm]                  # target language is Assembler
  6227.  -p[ascal]               # target language is Pascal
  6228.  -c                      # target language is C
  6229.  -h                      # highlight all characters enclosed by match
  6230.  -l                      # highlight entire lines containing match
  6231.  -n                      # generate error message if no match
  6232.  -v                      # display MatchIt's version number
  6233.  
  6234. Status codes returned:
  6235.   0    Normal termination.
  6236.   1    Parameter or option error.
  6237.   3    Matching delimiter not found (only if -n option specified).
  6238.  
  6239.                            Description
  6240.  
  6241.   Matches C, Pascal, and assembly-language delimiters with their mates
  6242.   in the specified window. The default window is the target window
  6243.   (second from front). The characters highlighted as the current selection1
  6244.   in the window are used as the left delimiter. MatchIt attempts to
  6245.   find the corresponding right mate for the selected delimiter.
  6246.  
  6247.   MatchIt is syntax sensitive, so that it is semi-intelligent about
  6248.   how it finds the matching delimiter. For example, if a Pascal BEGIN
  6249.   is the specified selection, MatchIt finds the proper END that matches
  6250.   it. All commenting conventions, strings, nesting, and so on are taken
  6251.   into account when searching for the end delimiter.
  6252.  
  6253.   The functionality of MatchIt is similar to the Shell editor’s ability
  6254.   to find mates for the characters ( [ { and '' when you double-click
  6255.   any of these characters. However, MatchIt differs from the Shell
  6256.   editor by supporting even more delimiters and using the knowledge
  6257.   of the target language syntax to find the proper match. The following
  6258.   table summarizes all the delimiters supported and for which languages:
  6259.  
  6260.  
  6261.                              Examples
  6262.  
  6263.   matchit  mysource.p
  6264.  
  6265.   For the current selected delimiter in the open window mysource.p,
  6266.   find the delimiter's mate. The language is assumed to be Pascal (because
  6267.   of the .p suffix.). No message is reported and the selection is not
  6268.   changed if the mate cannot be found. Of course, errors are still
  6269.   reported to diagnostic output if the input selection is not a valid
  6270.   Pascal delimiter (according to the table in “Options”). If MatchIt
  6271.   is to be used explicitly, a more general form for its use is shown
  6272.   in this example:
  6273.  
  6274.   matchit  -n  “{target}”
  6275.  
  6276.   For the current selected delimiter in the open target window, find
  6277.   the delimiter’s mate. The “{target}” specification could have been
  6278.   omitted, as it is MatchIt’s default. If explicitly specified, as
  6279.   shown here, it is best to quote it. The language is determined by
  6280.   the window’s name suffix (if present), or by the the selection, if
  6281.   the suffix is not acceptable to MatchIt. An error is reported if
  6282.   the mate cannot be found (-n).
  6283.  
  6284.   While the second example is more general than the first, and either
  6285.   might be useful for Shell scripts (particularly when the -n option
  6286.   is used), the real use for MatchIt is as a generalization of the
  6287.   the Shell editor’s own double-clicking delimiter matching mechanism.
  6288.   The following example illustrates this purpose:
  6289.  
  6290.   addmenu Edit 'Match It/µ' 'matchit  -n -h ∂
  6291.   “{active}”  ≥ “{MPW}”Errors || ∂
  6292.   alert  < “{MPW}”Errors'
  6293.  
  6294.   This example places a MatchIt call into the Edit menu as the command
  6295.   Match It with a command key Option-m (the µ). A selection is made
  6296.   in the current (that is, the {active}) window and the menu command
  6297.   invoked (by pressing Command-Option-m). If the match is found, all
  6298.   characters from the initially selected delimiter to its mate are
  6299.   highlighted (-h). If a match is not found, or if any other errors
  6300.   occur, an alert dialog box appears containing the error message.
  6301.   An auxiliary file, “{MPW}”Errors, is used for this purpose.
  6302.  
  6303.   Of course, you might not be interested in displaying the dialog box
  6304.   because you can see that the selection doesn’t change if there are
  6305.   any errors. Furthermore, you might not want superfluous files laying
  6306.   around (“{MPW}”Errors—although you could create a more elaborate
  6307.   AddMenu command to always delete this file). Thus, you could make
  6308.   the following simplification:
  6309.  
  6310.   addmenu Edit 'Match It/µ' 'matchit  -h  “{active}”  ≥ dev:null'
  6311.  
  6312.   This example places a MatchIt call into the Edit menu but with all
  6313.   errors ignored when the MatchIt command is executed.
  6314.  
  6315.   Limitations MatchIt does not process conditionals (that is, Pascal
  6316.   $ifc, C #if, and so on) during its scan except to find matching pairs.
  6317.   This might confuse MatchIt’s scanning process. Similarily, C macros
  6318.   and “\” continuations may also confuse MatchIt.
  6319.  
  6320.   MatchIt only finds a right delimiter to the specified left delimiter.
  6321.   Right-to-left matching is not supported.
  6322.  
  6323. æKY MergeBranch
  6324. æC        MergeBranch -- merge a branch revision onto the trunk
  6325.  
  6326. MergeBranch file…
  6327.  
  6328. Status codes returned:
  6329.   0    No Errors.
  6330.   1    Syntax Error.
  6331.   2    Error in Processing.
  6332.   3    System Error.
  6333.  
  6334.                            Description
  6335.  
  6336.   Merge the branch revision of the HFS file file onto the trunk. The
  6337.   file must belong to a currently mounted project and must be a branch
  6338.   revision (that is, the revision number contains one or more letters).
  6339.  
  6340.   MergeBranch uses the ProjectInfo command to determine what project
  6341.   file belongs to and whether file is in fact a branch revision. If
  6342.   all of the file's revisions are older than the branch, the branch
  6343.   will be checked in as the latest trunk revision. Otherwise MergeBranch
  6344.   checks out the latest revision on the trunk and calls CompareFiles
  6345.   to allow the user to manually cut and paste changes from the branch
  6346.   into the trunk revision. When done, the user can check the modified
  6347.   trunk revision back into the project.
  6348.  
  6349.   MergeBranch uses the CompareFiles script.
  6350.  
  6351.  
  6352.                              Examples
  6353.  
  6354.   MergeBranch file.c
  6355.  
  6356.   This example merges the branch revision in the file “file.c” onto
  6357.   the trunk.
  6358.  
  6359.   AddMenu Project 'Merge Branch' 'Merge Branch {Active} ∑∑ {WorkSheet}'
  6360.  
  6361.   This example adds MergeBranch to the Project menu and allows you
  6362.   to merge branch revisions onto the trunk.
  6363.  
  6364.  
  6365.                              See also 
  6366.  
  6367.   CompareFiles.
  6368.  
  6369. æKY ModifyReadOnly
  6370. æC  ModifyReadOnly -- enables a read-only Projector file to be edited
  6371.  
  6372. ModifyReadOnly file …
  6373.  
  6374. Status codes returned:
  6375.   0    No errors.
  6376.   1    Syntax error.
  6377.   2    Error in processing.
  6378.  
  6379.                            Description
  6380.  
  6381.   Write-enable a file that has been checked out as read-only. After
  6382.   executing this command on a file, the modified read-only icon is
  6383.   displayed in the window.
  6384.  
  6385.   This command is most useful on those rare occasions when you need
  6386.   to modify a read-only file. For example, suppose you have taken a
  6387.   number of modifiable files home. You may have also brought along
  6388.   certain read-only copies of files that you did not expect to modify,
  6389.   but once you get into your work at home you discover that you do,
  6390.   after all, need to make changes in these files.
  6391.  
  6392.   Note that this command takes only a single file for a parameter.
  6393.   This “feature” was intentional so that this command would not be
  6394.   overused.
  6395.  
  6396.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6397.   symbols used in Projector commands.
  6398.  
  6399.  
  6400.                              Examples
  6401.  
  6402.   Suppose file.c is checked out as read-only. You can write-enable
  6403.   it by using the ModifyReadOnly command:
  6404.  
  6405.   ModifyReadOnly file.c
  6406.  
  6407.   ProjectInfo :file.c -s
  6408.  
  6409.   The ProjectInfo command writes the following to standard output:
  6410.  
  6411.   file.c,5*
  6412.  
  6413.   Notice that an asterisk appears after the revision number when you
  6414.   get information about modified read-only files.
  6415.  
  6416.  
  6417.                              See also 
  6418.  
  6419.   CheckIn, CheckOut, CheckOutDir.
  6420.  
  6421. æKY Mount
  6422. æC                        Mount -- mount volumes
  6423.  
  6424. Mount drive…
  6425.  
  6426. Status codes returned:
  6427.   0    The disk was mounted.
  6428.   1    Syntax error.
  6429.   2    An error occurred.
  6430.  
  6431.                            Description
  6432.  
  6433.   Mounts the disks in the specified drives, making them accessible
  6434.   to the file system. Drive is the drive number.
  6435.  
  6436.   Mounting is normally automatic when a disk is inserted. The Mount
  6437.   command is needed for mounting multiple hard disks, which cannot
  6438.   be “inserted,” or for volumes that have been unmounted via the Unmount
  6439.   command.
  6440.  
  6441.  
  6442.                              Examples
  6443.  
  6444.   Mount 1
  6445.  
  6446.   Mounts the disk in drive 1 (the internal drive).
  6447.  
  6448.  
  6449.                              See also 
  6450.  
  6451.   Unmount and Volumes commands.
  6452.  
  6453. æKY MountProject
  6454. æC                    MountProject -- mount projects
  6455.  
  6456. MountProject ([-s] [-pp] [-q] [-r]) | [Project]
  6457.  -s                      # print names only, not commands
  6458.  -pp                     # list mounted projects using project paths
  6459.  -q                      # don't quote names with special characters
  6460.  -r                      # list projects recursively
  6461.  
  6462. Status codes returned:
  6463.   0    No errors.
  6464.   1    Syntax error.
  6465.   2    Error in processing.
  6466.   3    System error.
  6467.  
  6468.                            Description
  6469.  
  6470.   MountProject mounts (establishes a connection to) the specified project.
  6471.   Project is the HFS path of the project directory for the project.
  6472.   Once a project is mounted, that project and all its subprojects can
  6473.   be accessed.
  6474.  
  6475.   MountProject commands typically appear in the UserStartup file, a
  6476.   script, or an AddMenu to automatically mount the projects you typically
  6477.   access.
  6478.  
  6479.   If project is omitted, a list of all root projects is written to
  6480.   standard output in the form of MountProject commands.
  6481.  
  6482.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6483.   symbols used in Projector commands.
  6484.  
  6485.  
  6486.                              Examples
  6487.  
  6488.   MountProject FS:Zoom
  6489.   MountProject HD:localProjects:Test
  6490.  
  6491.   These commands mount the projects Zoom and Test.
  6492.  
  6493.   MountProject
  6494.   MountProject FS:MPW
  6495.   MountProject HD:localProjects:sort
  6496.  
  6497.   To obtain a list of the current root projects, execute the MountProject
  6498.   command without parameters.
  6499.  
  6500.  
  6501.                              See also 
  6502.  
  6503.   UnmountProject, Project, CheckOutDir.
  6504.  
  6505. æKY Move
  6506. æC                  Move -- move files and directories
  6507.  
  6508. Move [-y | -n | -c] [-p] name… target  ≥ progress
  6509.  -y                      # overwrite target files (avoids dialog)
  6510.  -n                      # don't overwrite target files (avoids dialog)
  6511.  -c                      # cancel if conflict occurs (avoids dialog)
  6512.  -p                      # write progress information to diagnostics
  6513.  
  6514. Status codes returned:
  6515.   0    All objects were moved.
  6516.   1    Syntax error.
  6517.   2    An error occurred during the move.
  6518.   4    Cancel was selected or implied with the -c option.
  6519.  
  6520.                            Description
  6521.  
  6522.   Moves name to targetName. (Name and targetName are file or directory
  6523.   names.) If targetName is a directory, one or more objects (files
  6524.   and/or directories) are moved into that directory. If targetName
  6525.   is a file or doesn’t exist, file or directory name replaces targetName.
  6526.   In either case, the old objects are deleted. Moved objects retain
  6527.   their current creation and modification dates.
  6528.  
  6529.   If a directory is moved, its contents, including all subdirectories,
  6530.   are also moved. No directory moved can be a parent of targetName.
  6531.  
  6532.   A dialog box requests a confirmation if the move would overwrite
  6533.   an existing file or folder. The -y, -n, or -c option can be used
  6534.   to avoid this interaction.
  6535.  
  6536.  
  6537.                              Examples
  6538.  
  6539.   Move Startup Suspend Resume Quit {SystemFolder}
  6540.  
  6541.   Moves the four files from the current directory to the System Folder.
  6542.  
  6543.   Move File ::
  6544.  
  6545.   Moves File from the current directory to the enclosing (parent) directory.
  6546.  
  6547.   Move -y File1 File2
  6548.  
  6549.   Moves File1 to File2, overwriting File2 if it exists. (This is the
  6550.   same as renaming the file.)
  6551.  
  6552.  
  6553.                              See also 
  6554.  
  6555.   Duplicate and Rename commands.
  6556.  
  6557.   “File and Window Names” in Chapter 4.
  6558.  
  6559.   “Filename Generation” in Chapter 5.
  6560.  
  6561. æKY MoveWindow
  6562. æC                 MoveWindow -- move window to h,v location
  6563.  
  6564. MoveWindow [h v] [-i] [window]
  6565.  h                       # horizontal position of top left corner
  6566.  v                       # vertical position of top left corner
  6567.  -i                      # ignore positioning errors
  6568.  
  6569. Status codes returned:
  6570.   0    No errors.
  6571.   1    Syntax error (error in parameters).
  6572.   2    The specified window does not exist.
  6573.   3    The h v location specified is invalid.
  6574.  
  6575.                            Description
  6576.  
  6577.   Moves the upper-left corner of the specified window to the location
  6578.   (h v), where h and v are horizontal and vertical integers, respectively.
  6579.   Use a space to separate the numbers h and v on the command line.
  6580.  
  6581.   The coordinates (0,0) are located at the left side of the screen
  6582.   at the bottom of the menu bar. If the location specified would place
  6583.   the window’s title bar entirely off the visible screen, an error
  6584.   is returned. (The -i option overrides the error.) If no window is
  6585.   specified, the target window (the second window from the front) is
  6586.   assumed. If no location is specified, the specified window’s location
  6587.   is returned without any effect on the window.
  6588.  
  6589.  
  6590.                              Examples
  6591.  
  6592.   MoveWindow 72 72
  6593.  
  6594.   Moves the target window’s upper-left corner to a point approximately
  6595.   one inch in from the upper-left corner of the screen, and one inch
  6596.   below the bottom of the menu bar. (There are about 72 pixels per
  6597.   inch on the Macintosh display screen.)
  6598.  
  6599.   MoveWindow
  6600.  
  6601.   Returns MoveWindow 72 72 when executed after the above example.
  6602.  
  6603.   MoveWindow 0 0 {Worksheet}
  6604.  
  6605.   Moves the Worksheet window to the upper-left corner of the screen
  6606.   (below the menu bar).
  6607.  
  6608.  
  6609.                              See also 
  6610.  
  6611.   SizeWindow, StackWindows, RotateWindows, TileWindows, and ZoomWindow
  6612.   commands.
  6613.  
  6614. æKY NameRevisions
  6615. æC                NameRevisions -- define a symbolic name
  6616.  
  6617. NameRevisions [-u User] [-project Project] [-public |private | -b] [-r]
  6618.      [[-only] | name [[-expand] [-s] | [-replace] [-dynamic] [names… | -a]]]
  6619.  -u user                 # name of current user
  6620.  -private                # create a private name
  6621.     -project project        # name of project that contains the revisions
  6622.  -public                 # create a public name
  6623.  -b                      # print both public and private names
  6624.  -expand                 # evaluate names to revision level before printing
  6625.  -only                   # only print the names, not the associated revisions
  6626.  -replace                # completely overwrite the previous definition of name
  6627.  -dynamic                # evaluate names to revision level when using not defining
  6628.  -r                      # recursively execute NameRevisions starting with current project
  6629.  -s                      # print a single name per line
  6630.  -a                      # all the files in the project
  6631.  
  6632. Status codes returned:
  6633.   0    No errors.
  6634.   1    Syntax error.
  6635.   2    Error in processing.
  6636.   3    System error.
  6637.  
  6638.                            Description
  6639.  
  6640.   Create a symbolic name to represent a set of revisions under Projector.
  6641.   Subsequently, when name is used in Projector commands, its value,
  6642.   names, is substituted in its place. Symbolic names are kept on a
  6643.   per-project basis and can be composed of filenames, revisions, branches,
  6644.   and other defined symbolic names. A symbolic name can include only
  6645.   one revision per file. The first character of a Name cannot be a
  6646.   digit (0–9). Also, commas, greater-than or less-than signs, (<, <,
  6647.   > >), or hyphens (-) are not allowed anywhere in a Name. Names are
  6648.   not case sensitive.
  6649.  
  6650.   If names is missing, the definition for name is listed. If name is
  6651.   missing, then NameRevisions lists all symbolic names in the project.
  6652.   In either case, the output is in the form of NameRevisions commands.
  6653.  
  6654.   By default, if names currently refers to a file listed in name, the
  6655.   revision for the file in name is modified to be the revision associated
  6656.   with the file in names. If there is a file in names which is not
  6657.   currently referred to by name, that file and revision is appended
  6658.   to name. To replace the definition of name, include the
  6659.  
  6660.   -replace option.
  6661.  
  6662.   The default is to create a private symbolic name. Include the -public
  6663.   option to make the symbolic name available to all users. You can
  6664.   add definitions for private symbolic names to UserStartup. Public
  6665.   symbolic name are stored with the project so they need to be defined
  6666.   only once. Do not put public symbolic name definitions in UserStartup.
  6667.  
  6668.   Projector checks for various errors both when a symbolic name is
  6669.   defined and when it is used. Errors include referring to a nonexistent
  6670.   file or referring to more than one revision in a file.
  6671.  
  6672.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6673.   symbols used in Projector commands.
  6674.  
  6675.  
  6676.                              Examples
  6677.  
  6678.   Assuming the latest revisions of the files file.c and interactive.c
  6679.   are 9 and 13 respectively, the first example defines a symbolic name
  6680.   “Work” that always expands to the files file.c,9 and interactive.c,13.
  6681.  
  6682.   NameRevisions Work file.c interactive.c
  6683.  
  6684.   The following command:
  6685.  
  6686.   CheckOut Work
  6687.  
  6688.   Is equivalent to:
  6689.  
  6690.   CheckOut file.c,9 interactive.c,13
  6691.  
  6692.   By omitting the Names parameter, the next NameRevisions command generates
  6693.   the current definition of Work.
  6694.  
  6695.   NameRevisions Work
  6696.   NameRevisions Work file.c,9 interactive.c,13
  6697.  
  6698.   The -dynamic is an important option. The following two commands illustrate
  6699.   its function:
  6700.  
  6701.   NameRevisions fred file.c
  6702.   NameRevisions -dynamic fred file.c
  6703.  
  6704.   The first command defines a symbolic name “fred” that always expands
  6705.   to the latest revision of file.c when fred was defined. The second
  6706.   example expands to the latest revision at the time of use. If the
  6707.   latest revision of file.c at the time fred was defined was 7 and
  6708.   the current latest revision is 9, the second NameRevisions command
  6709.   is equivalent to
  6710.  
  6711.   NameRevisions fred file.c,9
  6712.  
  6713.   The next command creates the symbolic name “file.c” that expands
  6714.   to the second revision off the first branch off the 1.1 revision
  6715.   of file.c.
  6716.  
  6717.   NameRevisions file.c file.c,1.1a2
  6718.  
  6719.   The command
  6720.  
  6721.   CheckOut file.c
  6722.  
  6723.   checks out revision 1.1a2 of file.c. The next example creates a Name
  6724.   “file.c” that expands to the latest version of the first branch off
  6725.   the 1.1 revision of file.c.
  6726.  
  6727.   NameRevisions -dynamic file.c file.c,1.1a
  6728.  
  6729.   So the checkout command
  6730.  
  6731.   CheckOut file.c
  6732.  
  6733.   will check out the latest revision on the first branch off revision
  6734.   1.1 of file.c.
  6735.  
  6736.   The next example defines all the latest revisions in the project
  6737.   Kerfroodi to be part of “v1.0 B1”. Because this a global name, all
  6738.   users accessing the Kerfroodi project will be able to use the name
  6739.   “v1.0 B1”.
  6740.  
  6741.   NameRevisions -public “vB1 1.0” -project Kerfroodi -a
  6742.  
  6743.   The name “BetaRelease” is defined recursively for all projects within
  6744.   the Zoom project:
  6745.  
  6746.   NameRevisions -project Zoom∫ -r “BetaRelease” -a
  6747.  
  6748.   Its behavior is the same as executing the following commands individually:
  6749.  
  6750.   NameRevisions -project Zoom “BetaRelease” -a
  6751.   NameRevisions -project Zoom∫Vroom “BetaRelease” -a
  6752.   NameRevisions -project Zoom∫Utilities “BetaRelease” -a
  6753.   NameRevisions -project Zoom∫Utilities∫Port “BetaRelease” -a
  6754.   ...
  6755.  
  6756.  
  6757.                              See also 
  6758.  
  6759.   ProjectInfo, DeleteNames.
  6760.  
  6761. æKY New
  6762. æC                       New -- open a new window
  6763.  
  6764. New [name…]
  6765.  
  6766. Status codes returned:
  6767.   0    No errors.
  6768.   1    Syntax error (error in parameters).
  6769.   2    Unable to complete operation; a file with the specified name already exists.
  6770.   3    System error.
  6771.  
  6772.                            Description
  6773.  
  6774.   Opens a new window as the active (frontmost) window. If name is not
  6775.   specified, the Shell generates a unique name for the new window,
  6776.   of the form “Untitled-n”, where n is a decimal number. If name already
  6777.   exists, an error results.
  6778.  
  6779.   You can use New to open several new windows by specifying a list
  6780.   of names separated by spaces. Note that New differs from Open -n
  6781.   by returning an error if the file already exists, whereas Open -n
  6782.   either opens an existing file or creates a new file.
  6783.  
  6784.   If the Shell variable {NewWindowRect} is defined, the windows are
  6785.   opened to that size and location.
  6786.  
  6787.  
  6788.                              Examples
  6789.  
  6790.   New
  6791.  
  6792.   Opens a new window with a Shell-generated name.
  6793.  
  6794.   New Test.a Test.p Test.c
  6795.  
  6796.   Creates three windows called Test.a, Test.p, and Test.c.
  6797.  
  6798.  
  6799.                              See also 
  6800.  
  6801.   Open command.
  6802.  
  6803. æKY Newer
  6804. æC             Newer -- compare modification dates of files
  6805.  
  6806. Newer [-c] [-e] [-q] file… target > newer
  6807.  -c               # compare creation dates
  6808.  -e               # report names that have same (equal) mod date as target
  6809.  -q               # don't quote file names with special characters
  6810.  
  6811. Status codes returned:
  6812.   0    No error.
  6813.   1    Syntax error.
  6814.   2    File not found.
  6815.  
  6816.                            Description
  6817.  
  6818.   Compares the modification dates of name and target. Files that have
  6819.   a more recent modification date than target have their names written
  6820.   to standard output. If the target is a nonexistent file or directory,
  6821.   all names that exist are considered newer than the target.
  6822.  
  6823.  
  6824.                              Examples
  6825.  
  6826.   Newer main.c main.c.bak
  6827.  
  6828.   Writes out main.c if its modification date is more recent than its
  6829.   backup.
  6830.  
  6831.   Newer HD:Source:≈.c HD:TimeStamp
  6832.  
  6833.   Writes to the screen all the source files in the Source directory
  6834.   that have been modified since the modification date of TimeStamp.
  6835.  
  6836.   If `Newer main.c main.c.bak`
  6837.     Duplicate main.c main.c.bak
  6838.   End
  6839.  
  6840.   Makes a backup copy of main.c only if it has been modified since
  6841.   the last backup was made.
  6842.  
  6843.   If “`Newer File.c File.h File.c.o`”
  6844.     C File.c -o file.c.o
  6845.   End
  6846.  
  6847.   Rebuilds the source file file.c if either file.c or file.h has been
  6848.   modified since file.c.o was last built.
  6849.  
  6850. æKY NewFolder
  6851. æC                   NewFolder -- create a new folder
  6852.  
  6853. NewFolder name…
  6854.  
  6855. Status codes returned:
  6856.   0    Folders were created for each name listed.
  6857.   1    Syntax error.
  6858.   2    An error occurred.
  6859.   3    Attempt to use NewFolder on a non-HFS volume.
  6860.  
  6861.                            Description
  6862.  
  6863.   Creates new directories with the names specified. Any parent directories
  6864.   included in the name specification must already exist.
  6865.  
  6866.     • Note: This command can be used only on hierarchical file system
  6867.     (HFS) disks.
  6868.  
  6869.  
  6870.                              Examples
  6871.  
  6872.   NewFolder Memos
  6873.  
  6874.   Creates Memos as a subdirectory of the current directory.
  6875.  
  6876.   NewFolder Parent :Parent:Kid
  6877.  
  6878.   Creates Parent as a subdirectory of the current directory, and Kid
  6879.   as a subdirectory of Parent.
  6880.  
  6881. æKY NewProject
  6882. æC                  NewProject -- create a new project
  6883.  
  6884. NewProject -w | -close | ([-u user] [-cs comment | -cf file] project)
  6885.  -cf file                # the comment is contained in file.
  6886.  -close                  # close the New Project window
  6887.  -cs comment             # a short description of the project
  6888.  -w                      # open the New Project window
  6889.  -u user                 # name of current user
  6890.  
  6891. Status codes returned:
  6892.   0    No errors.
  6893.   1    Syntax error.
  6894.   2    Error in processing.
  6895.   3    System error.
  6896.  
  6897.                            Description
  6898.  
  6899.   NewProject creates a project under control of Projector. A project
  6900.   directory is created to store the files, subprojects, and other information
  6901.   related to the project. The name of the directory is the name of
  6902.   the project.
  6903.  
  6904.   If project is a project pathname (such as MPW∫Tools∫Enterprise),
  6905.   Projector creates Enterprise as a subproject of the existing MPW∫Tools
  6906.   project. In this case MPW∫Tools must be a mounted project (see the
  6907.   MountProject command).
  6908.  
  6909.   If project is a leafname (such as Enterprise), project directory
  6910.   Enterprise is created in the current directory.
  6911.  
  6912.   Finally, if project is a partial or full HFS pathname (such as :Work:Enterprise
  6913.   or FS:Projects:Enterprise), the project Enterprise is created in
  6914.   the HFS location specified.
  6915.  
  6916.   Add a MountProject command to the UserStartup file, a script, or
  6917.   AddMenu to easily mount the new project.
  6918.  
  6919.   The checkout directory is initially set to the current directory
  6920.   (:). To change the checkout directory, refer to the CheckOutDir command.
  6921.  
  6922.   To add files to the new project, use the CheckIn command (with the
  6923.   -new option) or the Check In window.
  6924.  
  6925.   See Chapter 7 of the MPW manual for complete definitions of the terms and
  6926.   symbols used in Projector commands.
  6927.  
  6928.  
  6929.                              Examples
  6930.  
  6931.   The following command creates a project Enterprise in the current
  6932.   directory. No comment is saved with the project, but you can add
  6933.   one later by selecting the project in the Check Out window's /Info
  6934.   view.
  6935.  
  6936.   NewProject Enterprise
  6937.  
  6938.   The next example creates a project Zoom in the FS:work:Zoom. The
  6939.   -cf option indicates that the comment for the new project is contained
  6940.   in the file Info.
  6941.  
  6942.   NewProject FS:work:Zoom -cf Info
  6943.  
  6944.   Finally, given that the project Enterprise∫Utilities exists and has
  6945.   been mounted using the MountProject command, the next command creates
  6946.   a Zoom project in the Enterprise∫Utilities project. In this case
  6947.   you don’t need to add a MountProject command to UserStartup, but
  6948.   you may want to add a CheckOutDir command to set the checkout directory.
  6949.  
  6950.   NewProject Enterprise∫Utilities∫Zoom -cs ∂
  6951.   “Upgrade Zoom utility”
  6952.  
  6953.  
  6954.                              See also 
  6955.  
  6956.   CheckOutDir, MountProject, Project.
  6957.  
  6958. æKY Open
  6959. æC                  Open -- open file(s) in window(s)
  6960.  
  6961. Open [-n | -r] [-t] [name…]
  6962.  -n                      # open new file (default name Untitled)
  6963.  -r                      # open file for read-only use
  6964.  -t                      # open file as the target window
  6965.  
  6966. Status codes returned:
  6967.   0    No errors.
  6968.   1    Error in parameters.
  6969.   2    Unable to complete operation; specified file not found.
  6970.   3    System error.
  6971.  
  6972.                            Description
  6973.  
  6974.   Opens a file as the active (frontmost) window. If name is not specifed,
  6975.   StdFile’s GetFile routine is called, allowing you to use a dialog
  6976.   box to choose a file. If name is already open as a window, that window
  6977.   becomes the active (frontmost) window.
  6978.  
  6979.  
  6980.                              Examples
  6981.  
  6982.   Open
  6983.  
  6984.   Displays StdFile from which to choose a file to open.
  6985.  
  6986.   Open -r -t Test.a
  6987.  
  6988.   Opens the file Test.a as the target window, read-only.
  6989.  
  6990.   Open ≈.a
  6991.  
  6992.   Opens all the files that end with “.a”.
  6993.  
  6994.  
  6995.                              See also 
  6996.  
  6997.   Target, New, and Close commands.
  6998.  
  6999. æKY OrphanFiles
  7000. æC  OrphanFiles -- remove Projector information from a list of files
  7001.  
  7002. OrphanFiles file…
  7003.  
  7004. Status codes returned:
  7005.   0    No errors.
  7006.   1    Syntax error.
  7007.   2    Error in processing.
  7008.  
  7009.                            Description
  7010.  
  7011.   Remove the 'CKID' resource from file(s). This removes the identification
  7012.   information from the file that Projector uses to uniquely identify it.
  7013.  
  7014.     • Warning Once the projector information is removed from a file,
  7015.     you cannot check the file back into the Project as a checked-out
  7016.     file.
  7017.  
  7018.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7019.   symbols used in Projector commands.
  7020.  
  7021.  
  7022.                              Examples
  7023.  
  7024.   Suppose file.c and interactive.c belong to a project that has been
  7025.   deleted. We can remove the Projector information from them (so that
  7026.   they can be used for other purposes) with the command
  7027.  
  7028.   OrphanFiles file.c interactive.c
  7029.  
  7030.  
  7031.                              See also 
  7032.  
  7033.   TransferCkid.
  7034.  
  7035. æKY Parameters
  7036. æC                    Parameters -- write parameters
  7037.  
  7038. Parameters [parameter…]  > parameters
  7039.  
  7040. Status codes returned:   
  7041.   0    no errors is always returned.
  7042.  
  7043.                            Description
  7044.  
  7045.   The Parameters command writes its parameters, including its name,
  7046.   to standard output. The parameters are written one per line, and
  7047.   each is preceded by its parameter number (in braces) and a blank.
  7048.   This command is useful for checking the results of variable substitution,
  7049.   command substitution, quoting, blank interpretation, and filename
  7050.   generation.
  7051.  
  7052.  
  7053.                              Examples
  7054.  
  7055.   Parameters One Two “and Three”
  7056.  
  7057.   Writes the following four lines to standard output:
  7058.  
  7059.   {0} Parameters
  7060.   {1} One
  7061.   {2} Two
  7062.   {3} and Three
  7063.  
  7064.   Recall that “…” and '…' quotation marks are removed before parameters
  7065.   are passed to commands.
  7066.  
  7067.  
  7068.                              See also 
  7069.  
  7070.   Echo and Quote commands.
  7071.  
  7072.   “Parameters to Scripts” in Chapter 5.
  7073.  
  7074. æKY Pascal
  7075. æC                      Pascal -- Pascal compiler
  7076.  
  7077. Pascal [option…] [file…]  < file ≥ progress
  7078.     -b                   # generate A5 references for procedure addresses
  7079.     -c                   # syntax check only, don't create object file
  7080.     -clean               # erase all symbol table resources
  7081.     -d name=(TRUE|FALSE) # set compile time variable name
  7082.     -e file              # write errors to file
  7083.     -forward             # allow only explicit forward and external object declarations
  7084.     -h                   # suppress error messages regarding unsafe handles
  7085.     -i directory,…       # search for includes in directory,…
  7086.     -k directory         # create symbol table resource files in directory
  7087.     -m                   # allow greater than 32K globals by using 32 bit
  7088.     -mbg ch8             # include v2.0 compatible MacsBug symbols
  7089.     -mbg full            # include full (untruncated) symbols for MacsBug
  7090.     -mbg off             # don't include symbols for MacsBug
  7091.     -mbg number          # include MacsBug symbols truncated to length 
  7092.                          # number
  7093.     -mc68020             # generate MC68020 code 
  7094.     -mc68881             # generate MC68881 code for floating point operations
  7095.      -model farCode|     # generate load-time relocatable 32-bit references for
  7096.          farData|far     #   code, data, or both
  7097.      -model nearCode|    # generate 16-bit references for code, data, or both 
  7098.          nearData|near   #   (the default)
  7099.     -n                   # generate separate global data modules for better allocation
  7100.     -noload              # don't use or create any symbol table resources
  7101.     -o objname           # generate code in file or directory objname
  7102.     -only name…          # only generate code for named modules
  7103.     -ov                  # generate code to test for overflow
  7104.     -opt off             # don't apply code optimizations
  7105.     -opt on | full       # choose level of code optimization (full is default);
  7106.                          #   can modify with [,nopeep] [,nostatic]
  7107.     -p                   # write progress information to diagnostics
  7108.     -r                   # don't generate range checking code
  7109.     -rebuild             # rebuild all symbol table resources
  7110.     -sym off             # don't generate SADE records
  7111.     -sym on | full       # generate SADE records; can modify with [,nolines] [,notypes] [,novars]
  7112.     -t                   # write compilation time to diagnostics
  7113.     -u                   # initialize all data to $7267 for debugging use
  7114.     -w                   # don't perform peephole optimization
  7115.     -y directory         # create temporary files in directory
  7116.  
  7117. Status codes returned:
  7118.   0    Successful completion.
  7119.   1    Error in parameters.
  7120.   2    Compilation halted.
  7121.  
  7122.                            Description
  7123.  
  7124.   Compiles the specified Pascal source files (programs or units). You
  7125.   can specify zero or more filenames. Each file is compiled separately—compiling
  7126.   file Name .p creates object file Name .p.o. By convention, Pascal
  7127.   source filenames end in a “.p” suffix.
  7128.  
  7129.   See the MPW 3.0 Pascal Reference for details of the language definition.
  7130.  
  7131.  
  7132.                              Examples
  7133.  
  7134.   Pascal Sample.p
  7135.  
  7136.   Compiles the Sample program provided in the PExamples folder.
  7137.  
  7138.   Pascal File1.p File2.p -r
  7139.  
  7140.   Compiles File1.p and File2.p, producing object files File1.p.o and
  7141.   File2.p.o but performing no range checking.
  7142.  
  7143.     • Note: Listing files are not produced directly by the compiler.
  7144.     Refer to the PasMat and PasRef tools.
  7145.  
  7146.   Availability The MPW Pascal compiler is available as a separate Apple
  7147.   product.
  7148.  
  7149.  
  7150.                              See also 
  7151.  
  7152.   PasMat and PasRef commands.
  7153.  
  7154.   MPW 3.0 Pascal Reference.
  7155.  
  7156. æKY PascalIIGS
  7157. æC               PascalIIGS -- the MPW IIGS Pascal Compiler
  7158. PascalIIGS [option…] [file…] ≥ progress
  7159.  -c                   # syntax check only, don't create object file
  7160.  -d name=(TRUE|FALSE) # set compile time variable name
  7161.  -e file              # write errors to file
  7162.  -h                   # suppress error messages regarding unsafe handles
  7163.  -i directory,…       # search for includes in directory,…
  7164.  -o objname           # generate code in file or directory objname
  7165.  -p                   # write progress information to diagnostics
  7166.  -r                   # don't generate range checking code
  7167.  -t                   # write compilation time to diagnostics
  7168.  -u                   # initialize all data to $7267 for debugging use
  7169.  -y directory         # create temporary files in directory
  7170. æKY PasMat
  7171. æC                  PasMat -- Pasca programs formatter
  7172.  
  7173. PasMat [option…] [input [output]]  < input > output ≥ progress
  7174.  -a                      # set a-  disable CASE label bunching
  7175.  -b                      # set b+  enable IF bunching
  7176.  -body                   # set body+ to disable indenting procedure bodies
  7177.  -c                      # set c+  suppress Return before BEGIN
  7178.  -d                      # set d+  use {…} comment delimiters
  7179.  -e                      # set e+  capitalize identifiers
  7180.  -entab                  # replace multiple blanks with tabs
  7181.  -f                      # set f-  disable formatting
  7182.  -g                      # set g+  group assignment and call statements
  7183.  -h                      # set h-  disable FOR, WHILE, WITH bunching
  7184.  -i directory,…          # search for includes in directory,…
  7185.  -in                     # set in+ process includes
  7186.  -k                      # set k+  indent statements between BEGIN and END
  7187.  -l                      # set l+  literally copy reserved words, identifiers
  7188.  -list file              # write listings to file
  7189.  -n                      # set n+  group formal parameters
  7190.  -o width                # set output line width (default 80)
  7191.  -p                      # write progress information to diagnostics
  7192.  -pattern -old-new-      # modify include names, changing old to new
  7193.  -q                      # set q+  no special ELSE IF formatting
  7194.  -r                      # set r+  upper case reserved words
  7195.  -rec                    # set rec+ to indent field lists under defined id
  7196.  -s file                 # substitute identifiers based on pairs in file
  7197.  -t tab                  # set output tab setting (default 2)
  7198.  -u                      # rename identifiers to match first occurence
  7199.  -v                      # set v+  put THEN on separate line
  7200.  -w                      # set w+  upper case identifiers
  7201.  -x                      # set x+  suppress space around operators
  7202.  -y                      # set y+  suppress space around :=
  7203.  -z                      # set z+  suppress space after commas
  7204.  -:                      # set :+  align colons in VAR declarations
  7205.  -@                      # set @+  multiple CASE tags on separate lines
  7206.  -∂#                     # set #+  smart grouping of assignments and calls
  7207.  -_                      # set _+  delete _ from identifiers
  7208.  
  7209. Status codes returned:
  7210.   0    Normal termination.
  7211.   1    Parameter or option error.
  7212.  
  7213.                            Description
  7214.  
  7215.   Reformats Pascal source code into a standard format, suitable for
  7216.   printouts or compilation. PasMat accepts full programs, external
  7217.   procedures, blocks, and groups of statements.
  7218.  
  7219.     • Note: A syntactically incorrect program causes PasMat to abort.
  7220.     If this happens, the generated output will contain the formatted
  7221.     source up to the point of the error.
  7222.  
  7223.   PasMat options let you do the following:
  7224.  
  7225.     • Convert a program to uniform case conventions.
  7226.  
  7227.     • Indent a program to show its logical structure, and adjust
  7228.     lines to fit into a specified line length.
  7229.  
  7230.     • Change the comment delimiters ( * * ) to { } .
  7231.  
  7232.     • Remove the underscore character ( _ ) from identifiers, rename
  7233.     identifiers, or change their case.
  7234.  
  7235.     • Format include files named in MPW Pascal include directives.
  7236.  
  7237.   PasMat specifications can be made through PasMat options or through
  7238.   special formatter directives, which resemble Pascal compiler directives,
  7239.   and are inserted into the source file as Pascal comments. PasMat’s
  7240.   default formatting is straightforward and does not require you to
  7241.   use any options. The best way to find out how PasMat formats something
  7242.   is to try out a small example.
  7243.  
  7244.   See Appendix K of the MPW 3.0 Pascal Reference for details of PasMat
  7245.   directives and their functions. The first dialog box of the Pascal
  7246.   Commando dialog is reproduced here for your convenience.
  7247.  
  7248.  
  7249.                              Examples
  7250.  
  7251.   Pasmat -n -u -r -d -pattern “==formatted/=” Sample.p ∂
  7252.   “formatted/Sample.p”
  7253.  
  7254.   Formats the file Sample.p with the -n, -u, -r, and -d options and
  7255.   writes the output to the file “formatted/Sample.p”. Include files
  7256.   are processed
  7257.  
  7258.   ( -pattern ), and each Pascal compiler $I include file causes additional
  7259.   output files to be generated. Each of these files is created with
  7260.   the name “formatted/ filename ”, where filename is the filename specified
  7261.   in the corresponding include. (The -pattern parameter contains a
  7262.   null pattern (==) with “formatted/” as a replacement string—a null
  7263.   pattern always matches the start of a string.)
  7264.  
  7265.   Care must be taken when a command line contains quotes, slashes,
  7266.   or other special characters that are processed by the Shell itself.
  7267.   In this example, we used the slash character, so the strings containing
  7268.   it had to be quoted.
  7269.  
  7270.   Limitations PasMat has these limitations:
  7271.  
  7272.     • The maximum length of an input line is 255 characters.
  7273.  
  7274.     • The maximum output line length is 150 characters.
  7275.  
  7276.     • The input files and output files must be different.
  7277.  
  7278.     • Only syntactically correct programs, units, blocks, procedures,
  7279.     and statements are formatted. This limitation must be taken into
  7280.     consideration when separate MPW 3.0 include files and conditional
  7281.     compiler directives are to be formatted.
  7282.  
  7283.     • The Pascal include directive should be the last thing on the
  7284.     input line if include files are to be processed. Include files
  7285.     are processed to a maximum nesting depth of five. All include
  7286.     files not processed are summarized at the end of formatting.
  7287.     (This assumes, of course, that the in directive/option is in
  7288.     effect.)
  7289.  
  7290.     • The identifiers CYCLE and LEAVE are treated as reserved Pascal
  7291.     keywords by PasMat. They are treated as two loop control statements
  7292.     by Pascal unless explicitly declared.
  7293.  
  7294.     • While Pasmat supports Pascal’s $$Shell facility in include
  7295.     files, the processing of MPW’s {PInterfaces} files is not fully
  7296.     supported because these files conditionally include files (remember,
  7297.     conditionals are not processed). For this reason, do not use
  7298.     the -in or -e option to process files that include MPW {PInterfaces}
  7299.     files.
  7300.  
  7301.   Availability PasMat is available as part of a separate Apple product,
  7302.   MPW 3.0 Pascal .
  7303.  
  7304.  
  7305.                              See also 
  7306.  
  7307.   Pascal and PasRef commands.
  7308.  
  7309.   Appendix K of the MPW 3.0 Pascal Reference.
  7310.  
  7311. æKY PasRef
  7312. æC                  PasRef -- Pascal cross-referencer
  7313.  
  7314. PasRef [option…] [file…]  < file > crossReference ≥ progress
  7315.  -a                      # process includes and units each time encountered
  7316.  -c                      # process includes and units only once
  7317.     -cond                   # process $SETC and $IFC, $ELSEC, $ENDC conditionals
  7318.  -d                      # process each file separately
  7319.     -d name=TRUE|FALSE      # set $SETC variable name to TRUE or FALSE
  7320.  -i directory,…          # search for includes in directory,…
  7321.  -l                      # write identifiers in lower case
  7322.     -mc68020                # source contains {$IFC OPTION(MC68020)} directives
  7323.     -mc68881                # source contains {$IFC OPTION(MC68881)} directives
  7324.  -n                      # don't process USES or includes
  7325.  -ni | -noi[ncludes]     # don't process include files
  7326.  -nl | -nol[istings]     # don't list the input
  7327.  -nolex                  # don't write lexical information
  7328.  -nt | -not[otal]        # don't write total line count
  7329.  -nu | -nou[ses]         # don't process USES declarations   
  7330.  -o                      # source written using Object Pascal
  7331.  -p                      # write progress information to diagnostics
  7332.  -s                      # don't write include and USES filenames
  7333.  -t                      # cross reference by total line number
  7334.  -u                      # write identifiers in upper case
  7335.  -w width                # set output line width (default 110)
  7336.  -x width                # set maximum identifier width
  7337.  
  7338. Status codes returned:
  7339.   0    Normal termination.
  7340.   1    Parameter or option error.
  7341.  
  7342.                            Description
  7343.  
  7344.   Reads Pascal source files and writes a listing of the source followed
  7345.   by a cross-reference listing of all identifiers. Each identifier
  7346.   is listed in alphabetical order, followed by the number of the line
  7347.   on which it appears. Line numbers can refer to the entire source
  7348.   file, or can be relative to individual include files and units. Each
  7349.   reference indicates whether the identifier is defined, assigned,
  7350.   or simply named (for example, used in an expression).
  7351.  
  7352.   See the MPW 3.0 Pascal Reference for more information about the Pascal
  7353.   language. The first dialog box of PasRef’s Commando dialog is reproduced
  7354.   here for your convenience.
  7355.  
  7356.   Identifiers may be up to 63 characters long and are displayed in
  7357.   their entirety unless overridden with the -x directive. Identifiers
  7358.   can remain as they appear in the input, or they can be converted
  7359.   to all lowercase (-l ) or all uppercase (-u).
  7360.  
  7361.   For include files, line numbers are relative to the start of the
  7362.   include file; an additional key number indicates which include file
  7363.   is referred to. A list of each include file processed and its associated
  7364.   key number is displayed prior to the cross-reference listing.
  7365.  
  7366.   USES declarations can also be processed by PasRef (their associated
  7367.   $U filename compiler directives are processed as in the Pascal compiler).
  7368.   These declarations are treated exactly like includes, and, as with
  7369.   the compiler, only the outermost USES declaration is processed (that
  7370.   is, a used unit’s USES declaration is not processed).
  7371.  
  7372.   As an alternative to processing USES declarations, PasRef accepts
  7373.   multiple source files. Thus you cross-reference a set of main programs
  7374.   together with the units they use. All the sources are treated like
  7375.   include files for display purposes. In addition, PasRef checks to
  7376.   see whether it has already processed a file (for example, if it appeared
  7377.   twice on the input list, or if one of the files already used or included
  7378.   it). The file is skipped it has already been processed.
  7379.  
  7380.  
  7381.                              Examples
  7382.  
  7383.   PasRef -nu -w 80 Memory.p > Memory.p.Xref
  7384.  
  7385.   Cross-references the sample desk accessory Memory.p and writes the
  7386.   output to the file Memory.p.Xref. No USES declarations are processed
  7387.   (-nu). The following source and cross-reference listings are generated:
  7388.  
  7389.   1 1 1 -- {
  7390.   2 1 2 -- File Memory.p
  7391.   3 1 3 --
  7392.   4 1 4 -- Copyright Apple Computer, Inc. 1985-1987
  7393.   5 1 5 -- All rights reserved.
  7394.   6 1 6 -- }
  7395.   7 1 7 --
  7396.   8 1 8 -- {$D+} { MacsBug symbols on }
  7397.   9 1 9 -- {$R-} { No range checking }
  7398.   10 1 10 --
  7399.   11 1 11 -- UNIT Memory;
  7400.   12 1 12 --
  7401.   13 1 13 -- INTERFACE
  7402.   14 1 14 --
  7403.   15 1 15 -- USES
  7404.   16 1 16 -- MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf;
  7405.   17 1 17 --
  7406.   18 1 18 --
  7407.   19 1 19 -- FUNCTION DRVROpen (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7408.   20 1 20 -- FUNCTION DRVRControl (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7409.   21 1 21 -- FUNCTION DRVRStatus (ctlPB: ParmBlkPtr; dCtl:.DCtlPtr):OSErr;
  7410.   22 1 22 -- FUNCTION DRVRPrime (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7411.   23 1 23 -- FUNCTION DRVRClose (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7412.   24 1 24 --
  7413.   25 1 25 --
  7414.   26 1 26 -- IMPLEMENTATION
  7415.   etc.
  7416.  
  7417.   63 1 63 --A FUNCTION DRVRClose (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7418.   64 1 64 0-A BEGIN
  7419.   65 1 65 -- IF dCtl^.dCtlwindow <> NIL THEN
  7420.   66 1 66 1- BEGIN
  7421.   67 1 67 -- DisposeWindow (WindowPtr(dCtl^.dCtlWindow));
  7422.   68 1 68 -- dCtl^.dCtlWindow := NIL;
  7423.   69 1 69 -1 END;
  7424.   70 1 70 -- DRVRClose := NOErr;
  7425.   71 1 71 -0A END;
  7426.   etc.
  7427.  
  7428.   178 1 178 --
  7429.   179 1 179 -- END. {of memory UNIT}
  7430.   180 1 180 --
  7431.  
  7432.   Each line of the source listing is preceded by five columns of information:
  7433.  
  7434.   1. The total line count.
  7435.  
  7436.   2. The include key assigned by PasRef for an include or USES file.
  7437.   (See below.)
  7438.  
  7439.   3. The line number within the include or main file.
  7440.  
  7441.   4. Two indicators (left and right) that reflect the static block
  7442.   nesting level. The left indicator is incremented (mod 10) and displayed
  7443.   whenever a BEGIN, REPEAT, or CASE is encountered. On termination
  7444.   of these structures with an END or UNTIL, the right indicator is
  7445.   displayed, then decremented. It is thus easy to match BEGIN, REPEAT,
  7446.   and CASE statements with their matching terminations.
  7447.  
  7448.   5. A letter that reflects the static level of procedures. The character
  7449.   is updated for each procedure nest level (“A” for level 1, “B” for
  7450.   level 2, and so on), and displayed on the line containing the heading,
  7451.   and on the BEGIN and END associated with the procedure body. Using
  7452.   this column you can easily find the procedure body for a procedure
  7453.   heading when there are nested procedures declared between the heading
  7454.   and its body.
  7455.  
  7456.   The cross-reference listing follows:
  7457.  
  7458.   1. Memory.p
  7459.  
  7460.   -A-
  7461.  
  7462.   accEvent 144 ( 1)
  7463.   accRun 158 ( 1)
  7464.   ApplicZone 121 ( 1)
  7465.   Away 33* ( 1) 146 ( 1)
  7466.  
  7467.   -B-
  7468.  
  7469.   BeginUpdate 151 ( 1)
  7470.   BNOT 39 ( 1)
  7471.   Bold ( 1) 117 ( 1)
  7472.   Boolean 31* ( 1)
  7473.   BOR 39 ( 1)
  7474.   BSL 39 ( 1)
  7475.  
  7476.   -C-
  7477.  
  7478.   csCode 143 ( 1)
  7479.   CSParam 146 ( 1)
  7480.   ctlPB 19* ( 1) 20*( 1) 21*( 1) 22*( 1)..23*( 1) 43*( 1)
  7481.         63* ( 1) 74*( 1) 143 ( 1) 146 ( 1) 168*( 1) 173*( 1)
  7482.  
  7483.   -D-
  7484.  
  7485.   dCtl 19* ( 1) 20*( 1) 21*( 1) 22*( 1) 23*( 1) 37*( 1)
  7486.        39  ( 1) 43*( 1) 50 ( 1) 53 ( 1) 54 ( 1) 55 ( 1)
  7487.        63* ( 1) 65 ( 1) 67 ( 1) 68 ( 1) 74*( 1) 115 ( 1)
  7488.        142 ( 1) 168*( 1) 173*( 1)
  7489.   DCtlPtr 19 ( 1) 20 ( 1) 21 ( 1) 22 ( 1) 23 ( 1) 37 ( 1)
  7490.           43 ( 1) 63 ( 1) 74 ( 1) 168 ( 1) 173 ( 1)
  7491.   dCtlRefNum 39 ( 1) 54 ( 1)
  7492.   dCtlWindow 50 ( 1) 55=( 1) 67 ( 1) 68=( 1) 142 ( 1)
  7493.   etc.
  7494.  
  7495.   -V-
  7496.  
  7497.   VolName 79* ( 1) 100 ( 1) 135 ( 1)
  7498.  
  7499.   -W-
  7500.  
  7501.   what 149 ( 1)
  7502.   WindowKind 54= ( 1)
  7503.   windowpeek 54 ( 1)
  7504.   WindowPtr 48 ( 1) 67 ( 1) 151 ( 1) 153 ( 1)
  7505.   wRect 47* ( 1)
  7506.  
  7507.   *** End PasRef: 105 id's 249 references
  7508.  
  7509.   The numbers in parentheses following the line numbers are the include
  7510.   keys of the associated include files (shown in column 2 of the source
  7511.   listing). The include filenames are shown following the source listing.
  7512.   You can thus see what line number was in which include file. An asterisk
  7513.   (*) following a line number indicates a definition of the variable.
  7514.   An equal sign (=) indicates an assignment. A line number with nothing
  7515.   following it indicates a reference to the identifier.
  7516.  
  7517.   Limitations PasRef has these limitations:
  7518.  
  7519.     • PasRef does not process conditional compilation directives!
  7520.     Thus, given the “right” combination of $IFCs and $ELSECs, PasRef’s
  7521.     lexical (nesting) information can be thrown off. If this happens,
  7522.     or if you don’t want the lexical information, you can specify
  7523.     the -nolex option.
  7524.  
  7525.     • PasRef stores all its information on the Pascal heap. Up to
  7526.     5000 identifiers can be handled, but more identifiers will mean
  7527.     less cross-reference space. A message appears if PasRef runs
  7528.     out of heap space.
  7529.  
  7530.     • Note: Although PasRef never misses a reference, it can infrequently
  7531.     be fooled into thinking that a variable is defined when it actually
  7532.     isn’t. One case where this happens is in record structure variants.
  7533.     The record variant’s case tag is always flagged as a definition
  7534.     (even when there is no tag type) and the variant’s case label
  7535.     constants (if they are identifiers) are also sometimes incorrectly
  7536.     flagged, depending on the context. (This occurs only in the declaration
  7537.     parts of the program.)
  7538.  
  7539.     • While PasRef supports Pascal’s $$Shell facility in include
  7540.     files and USES declarations, the processing of MPW’s {PInterfaces}
  7541.     files is not fully supported because these files conditionally
  7542.     include files (remember, conditionals are not processed). For
  7543.     this reason, always use the -nu option to suppress processing
  7544.     of USES declarations.
  7545.  
  7546.     • The identifiers CYCLE and LEAVE are treated as reserved Pascal
  7547.     keywords by PasRef. These are treated as two loop control statements
  7548.     by Pascal unless explicitly declared.
  7549.  
  7550.   Availability PasRef is available as part of a separate Apple product,
  7551.   MPW 3.0 Pascal.
  7552.  
  7553.  
  7554.                              See also 
  7555.  
  7556.   Pascal command.
  7557.  
  7558.   MPW 3.0 Pascal Reference.
  7559.  
  7560. æKY Paste
  7561. æC          Paste -- replace selection with Clipboard contents
  7562.  
  7563. Paste [-c count] selection [window]
  7564.  -c count                # repeat the Paste count times
  7565.  
  7566. Status codes returned:
  7567.   0    At least one instance of the selection was found.
  7568.   1    Syntax error.
  7569.   2    Any other error.
  7570.  
  7571.                            Description
  7572.  
  7573.   Finds selection in the specified window and replaces its contents
  7574.   with the contents of the Clipboard. If no window is specified, the
  7575.   command operates on the target window (the second window from the
  7576.   front). It’s an error to specify a window that doesn’t exist.
  7577.  
  7578.   For a definition of selection, see “Selections” in Chapter 6 of the MPW 
  7579.   manual; a summary of the selection syntax is contained in Appendix B.
  7580.  
  7581.  
  7582.                              Examples
  7583.  
  7584.   Paste §
  7585.  
  7586.   Replaces the current selection with the contents of the Clipboard.
  7587.   This command is like the Paste item in the Edit menu, except that
  7588.   the action occurs in the target window.
  7589.  
  7590.   Paste /BEGIN/:/END/
  7591.  
  7592.   Selects everything from the next BEGIN to the following END and replaces
  7593.   the selection with the contents of the Clipboard.
  7594.  
  7595.  
  7596.                              See also 
  7597.  
  7598.   Copy, Cut, and Replace commands.
  7599.  
  7600.   “Edit Menu” in Chapter 3.
  7601.  
  7602.   “Selections” in Chapter 6.
  7603.  
  7604. æKY PerformReport
  7605. æC            PerformReport -- generate a performance report
  7606.  
  7607. PerformReport [option…]  > reportFile ≥ progress
  7608.  -a                      # list all procedures, in segment order
  7609.                          # (default: produce only partial list, sorted by %)
  7610.  -l linkDataFile         # read link map file (concatenated with ROM.list)
  7611.  -m measurementsFile     # read performance measurements file
  7612.                          # (default: "Perform.Out")
  7613.  -n NN                   # show the top NN procedures (default: 50)
  7614.  -p                      # write progress information to diagnostics
  7615.  
  7616. Status codes returned:
  7617.   0    No errors.
  7618.   1    Warning issued.
  7619.   2    Error encountered.
  7620.   3    Heap error;usually insufficient memory.
  7621.  
  7622.                            Description
  7623.  
  7624.   PerformReport reads a link map file and a performance data file and
  7625.   produces a report that relates the performance data to procedure
  7626.   names. The input files are both text files and are distinguished
  7627.   as separate options. For a full discussion of MPW’s performance measurement
  7628.   tools, see Chapter 14 of the MPW manual.
  7629.  
  7630.  
  7631.                              Examples
  7632.  
  7633.   Catenate “{MPW}”ROM.Maps:MacIIROM.map >> myMapFileName
  7634.  
  7635.   PerformReport -l myMapFileName > myReport
  7636.  
  7637.   Adds the ROM map file to the end of the link map file, myMapFileName.
  7638.   Reads the files myMapFileName and Perform.out and writes the output
  7639.   to myReport.
  7640.  
  7641.  
  7642.                              See also 
  7643.  
  7644.   Chapter 14, “Performance-Measurement Tools.”
  7645.  
  7646.   MPW 3.0 Pascal Reference.
  7647.  
  7648.   MPW 3.0 C Reference .
  7649.  
  7650. æKY Position
  7651. æC              Position -- display current line position
  7652.  
  7653. Position [-l | -c] [window…]
  7654.  -l                      # only list the line number
  7655.  -c                      # only list the character offsets
  7656.  
  7657. Status codes returned:
  7658.   0    No errors.
  7659.   1    Syntax error.
  7660.   2    Any other error.
  7661.  
  7662.                            Description
  7663.  
  7664.   Position displays the position of the selection in each of the windows
  7665.   specified. If no window is specified, the position of the selection
  7666.   in the Target window is given. By default, the position is displayed
  7667.   as both the line number of the start of the selection and the character
  7668.   positions of the start and end of the selection. The -c option can
  7669.   be used to display only the character positions of the selection.
  7670.   Similarly, the -l option can be used to display only the line number.
  7671.  
  7672.  
  7673.                              Examples
  7674.  
  7675.   Position {Target} file2
  7676.  
  7677.   Displays the position of the selection in both the Target and file2
  7678.   in the following form:
  7679.  
  7680.   578 23129,23140
  7681.  
  7682.   211 8440,8440
  7683.  
  7684.  
  7685.                              See also 
  7686.  
  7687.   Find command.
  7688.  
  7689. æKY Print
  7690. æC                      Print -- print text files
  7691.  
  7692. Print [option…] file…  < file ≥ progress
  7693.  -b                   # print a border around the text
  7694.  -b2                  # alternate form of border
  7695.  -bm n[.n]            # bottom margin in inches (default 0)
  7696.  -c[opies] n          # print n copies
  7697.  -ff string           # treat "string" at beginning of line as a formfeed
  7698.  -f[ont] name         # print using specified font
  7699.  -from n              # begin printing with page n
  7700.  -h                   # print headers (time, file, page)
  7701.  -hf[ont] name        # print headers using specified font
  7702.  -hs[ize] n           # print headers using specified font size
  7703.  -l[ines] n           # print n lines per page
  7704.  -lm n[.n]            # left margin in inches (default .2778)
  7705.  -ls n[.n]            # line spacing (2 means double-space)
  7706.  -md                  # use modification date of file for time in header
  7707.  -n                   # print line numbers to left of text
  7708.  -nw [-]n             # width of line numbers, - indicates zero padding
  7709.  -p                   # write progress information to diagnostics
  7710.  -page n              # number pages beginning with n
  7711.  -ps filename         # include PostScript file as background for each page
  7712.     -q quality           # print quality (HIGH, STANDARD, DRAFT)
  7713.  -r                   # print pages in reverse order
  7714.  -rm n[.n]            # right margin in inches (default 0)
  7715.  -s[ize] n            # print using specified font size
  7716.  -t[abs] n            # consider tabs to be n spaces
  7717.  -title title         # include title in page headers
  7718.  -tm n[.n]            # top margin in inches (default 0)
  7719.  -to n                # stop printing after page n
  7720.  
  7721. Status codes returned:
  7722.   0    Successful completion.
  7723.   1    Parameter or option error.
  7724.   2    Execution error.
  7725.  
  7726.                            Description
  7727.  
  7728.   Prints text files on the currently selected printer. (Printers are
  7729.   selected with the Chooser desk accessory.) One or more files may
  7730.   be printed.
  7731.  
  7732.     • Note: Print does not substitute fonts unless the “Font Substitution”
  7733.     box is checked in the “LaserWriter Page Setup” dialog. To print
  7734.     in a font other than that indicated in the resource fork of the
  7735.     file where the MPW editor stores font information, use the -font
  7736.     option.
  7737.  
  7738.     • Important Print requires the printer drivers available on version
  7739.     1.0 (or later) of the Printer Installation disk.
  7740.  
  7741.  
  7742.                              Examples
  7743.  
  7744.   Print -h -size 8 -ls 0.85 Startup UserStartup
  7745.  
  7746.   Prints the files Startup and UserStartup with page headers, using
  7747.   Monaco 8 and compressing the line spacing.
  7748.  
  7749.   Print -b -hf helvetica -hs 12 -r print.p
  7750.  
  7751.   Prints the “print.p” source file with borders, with headers in Helvetica
  7752.   12, and with pages in reverse order.
  7753.  
  7754.  
  7755.                              See also 
  7756.  
  7757.   Print menu item in “File Menu,” Chapter 3.
  7758.  
  7759. æKY ProcNames
  7760. æC        ProcNames -- display Pascal procedure and function names
  7761.  
  7762. ProcNames [option…] [file…]  < file ≥ progress
  7763.     -b                      # display line info for procedure body
  7764.     -c                      # process includes and units only once
  7765.     -cond                   # process $SETC and $IFC, $ELSEC, $ENDC conditionals
  7766.     -d                      # reset total line count to 1 on each new file
  7767.     -d name=TRUE|FALSE      # set $SETC variable name to TRUE or FALSE
  7768.     -e                      # suppress page eject between each procedure listing
  7769.     -f                      # PasMat format compatibility mode
  7770.     -i pathname,…           # search for includes or USES in directory,…
  7771.     -l n                    # process only to max nesting level n
  7772.     -m                      # generate MPW Mark commands for procedure and function declarations
  7773.     -mc68020                # source contains {$IFC OPTION(MC68020)} directives
  7774.     -mc68881                # source contains {$IFC OPTION(MC68881)} directives
  7775.     -n                      # suppress line number and level information
  7776.     -o                      # source file is an Object Pascal program
  7777.     -p                      # write progress information to diagnostics
  7778.     -u                      # process USES declarations
  7779.  
  7780.   Status codes returned:
  7781.      0    Normal termination.
  7782.      1    Parameter or option error.
  7783.  
  7784.                            Description
  7785.  
  7786.   ProcNames is a Pascal utility that accepts a Pascal program or unit
  7787.   as input and produces a listing of all its procedure and function
  7788.   names. The names are shown indented as a function of their nesting
  7789.   level. The nesting level and line-number information is also displayed.
  7790.  
  7791.   ProcNames can be used in conjunction with the Pascal “pretty-printer”
  7792.   PasMat when that utility is used to format separate include files.
  7793.   For that case, PasMat requires that the initial indenting level be
  7794.   specified. This level is exactly the information provided by ProcNames.
  7795.  
  7796.   The line-number information displayed by ProcNames exactly matches
  7797.   that produced by the Pascal cross-reference utility PasRef (with
  7798.   or without USES declarations being processed), so ProcNames can be
  7799.   used in conjunction with the listing produced by PasRef to show just
  7800.   the line numbers of every procedure or function header.
  7801.  
  7802.   Another possible use for the ProcNames output is to use the line-number
  7803.   and file information to find procedures and functions quickly with
  7804.   Shell editing commands.
  7805.  
  7806.  
  7807.                              Examples
  7808.  
  7809.   procnames Memory.p >names
  7810.  
  7811.   Lists all the procedures and functions for the Pascal program Memory.p
  7812.   and writes the output to the file “names”. The listing below is the
  7813.   output generated in the “names” file.
  7814.  
  7815.   Procedure/Function names for Memory.p
  7816.  
  7817.    11  11 0 Memory[Main] Memory.p
  7818.    37  37 1 RsrcID
  7819.    43  43 1 DRVROpen
  7820.    63  63 1 DRVRCloseaa
  7821.    74  74 1 DRVRControla
  7822.    76  76 2   DrawWindow
  7823.    83  83 3     PrintNum
  7824.    93  93 3     GetVolStuff
  7825.   108 108 3     PrtRsrcStr
  7826.   168 168 1 DRVRPrime
  7827.   173 173 1 DRVRStatus
  7828.  
  7829.   *** End ProcNames: 11 Procedures and Functions
  7830.  
  7831.   The first two columns on each line are line-number information. The
  7832.   third column is the level number. The first column shows the line
  7833.   number of a routine within the total source. The second column shows
  7834.   the line number within an include file (include files are always
  7835.   processed). As each include file changes, the name of the file from
  7836.   which input is being processed is shown along with the routine name
  7837.   on the first line after the change in source. Segment names (from
  7838.   Pascal compiler $S directives) are similarly processed. These are
  7839.   shown enclosed in square brackets (the blank segment name is shown
  7840.   as “[Main]”).
  7841.  
  7842.   Limitations Only syntactically correct programs are accepted by ProcNames.
  7843.   Conditional compilation compiler directives are not processed.
  7844.  
  7845.   Although ProcNames supports $$Shell facility in includes and USES,
  7846.   the processing of MPW’s {PInterfaces} files is not fully supported
  7847.   because these files conditionally include files. Therefore, do not
  7848.   use the -u option.
  7849.  
  7850. æKY Project
  7851. æC             Project -- set or write the current project
  7852.  
  7853. Project [-q | projectName]   > project
  7854.  -q                      # don't quote projects with special characters
  7855.  
  7856. Status codes returned:
  7857.   0    No errors.
  7858.   1    Syntax error.
  7859.   2    Error in processing.
  7860.  
  7861.                            Description
  7862.  
  7863.   Set the current project to projectname or list the current project
  7864.   if projectname is omitted. Projectname must be a mounted project.
  7865.   Refer to the MountProject command for information on how to mount
  7866.   projects.
  7867.  
  7868.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7869.   symbols used in Projector commands.
  7870.  
  7871. æKY ProjectInfo
  7872. æC          ProjectInfo -- display information about a Project
  7873.  
  7874. ProjectInfo [-project project] [-comments] [-latest] [-f] [-r] [-s] [-only 
  7875.             | -m] [-af author | -a author] [-df dates | -d dates] 
  7876.             [-cf pattern | -c pattern] [-t pattern] [-n name] 
  7877.             [-newer | -update] [file…]
  7878.  -a author         # only list revisions created by author
  7879.  -af author        # only list files created by author
  7880.  -c pattern        # only list revisions whose comment contains pattern
  7881.  -cf pattern       # only list files whose comment contains pattern
  7882.  -comments         # list comments along with the rest of the information
  7883.  -d dates          # only list revisions whose create date is within dates
  7884.  -df dates         # only list files whose mod date is within dates
  7885.  -f                # list file information
  7886.  -log              # print project log
  7887.  -m                # only list files/revisions that are checked out
  7888.  -newer            # info on files that would be checked out using this option
  7889.  -only             # only list project information
  7890.  -project project  # name of project to get information on
  7891.  -r                # recursively list subprojects
  7892.  -latest           # only list info on the latest revision on the main trunk
  7893.  -s                # short listing, names and revision names only
  7894.  -t pattern        # only list revisions whose task contains pattern
  7895.  -n name           # only list revisions that have name
  7896.  -update           # info on files that would be checked out using this option
  7897.  
  7898.  Note: pattern is either a literal string or /regular expression/.
  7899.  
  7900.  Note: "dates" may take the following forms:
  7901.      date                # on date
  7902.      <date               # before but not including date
  7903.      ≤date               # before and including date
  7904.      >date               # after and not including date
  7905.      ≥date               # after and including date
  7906.      date-date           # between and including dates
  7907.      
  7908.  Note:  A date is mm/dd/yy [[hh:mm[:ss]] [AM|PM]]
  7909.  
  7910.  Note: "name" may take the following forms:
  7911.      name                # in name
  7912.      <name               # before name
  7913.      ≤name               # before and including name
  7914.      >name               # after name
  7915.      ≥name               # after and including name
  7916.  
  7917. Status codes returned:
  7918.   0    No errors.
  7919.   1    Syntax error.
  7920.   2    Error in processing.
  7921.   3    System error.
  7922.  
  7923.                            Description
  7924.  
  7925.   By default (with no options specified), ProjectInfo lists information
  7926.   about each revision in every revision tree (file) in the current
  7927.   project. This behavior can be changed using the various options.
  7928.   For example, using the -latest option will display only information
  7929.   about the latest revision on the main trunk of each revision tree.
  7930.   Using the -f option will display information about the revision tree,
  7931.   rather than the particular revisions within that tree. Various other
  7932.   options exist that filter the output such that only the information
  7933.   (typically revisions) that passes through the filter is listed.
  7934.  
  7935.   If object is a project pathname such as Enterprise∫Phaser∫file.c
  7936.   or Enterprise∫Phaser, Projector lists information about every revision
  7937.   of file.c in the Phaser project, or information about every revision
  7938.   tree in the project Enterprise∫Phaser, respectively.
  7939.  
  7940.   If object is a leafname such as file.c, Projector looks in the current
  7941.   project for a revision tree with that name. If found, information
  7942.   about every revision in that revision tree (file.c) is listed. If
  7943.   the file is not a member of the current project, Projector looks
  7944.   for the file in the current directory. If the file exists and is
  7945.   part of a project, then the current state of that file is listed.
  7946.   Projector can determine whether a file belongs to a project because
  7947.   that information is maintained in the resource fork of all checked-out
  7948.   files.
  7949.  
  7950.   Finally, if object is a valid partial or full HFS pathname of a file,
  7951.   and the file is part of a project, then the current state of that
  7952.   file is listed.
  7953.  
  7954.   To list the contents of a specific revision of a file, append a comma
  7955.   followed by the revision number to the filename specified. For example,
  7956.   revision 22 of file.c is specified as file.c,22.
  7957.  
  7958.   You can use the -af, -a, -df, -d, -n, -cf, -c, and -t options to
  7959.   filter (constrain) the information listed to specific authors, dates,
  7960.   names, specific comments, or tasks.
  7961.  
  7962.   Use the -log option to display a log of all changes to the project.
  7963.   These commands are logged: NameRevisions, DeleteRevisions, and DeleteNames.
  7964.  
  7965.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7966.   symbols used in Projector commands.
  7967.  
  7968.  
  7969.                              Examples
  7970.  
  7971.   In the example below, the current project has three files. The -latest
  7972.   option is used so that only information about the latest revision
  7973.   on the main trunk is listed. The presence of the plus sign (+) indicates
  7974.   that Bob currently has revision 22 of file.c checked out for modification,
  7975.   and that Peter has revision 33 of hdr.c checked out for modification.
  7976.   The date field of these two files reflects the date and time they
  7977.   were checked out. Because no plus sign appears on the line for file.h,
  7978.   it can be checked out for modification. The latest revision of file.h
  7979.   is 17, and the author of the revision is Bob.
  7980.  
  7981.   ProjectInfo -latest
  7982.  
  7983.   Sample∫
  7984.   file.c,22+
  7985.     Owner: Bob
  7986.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  7987.     Task: Fixing bug #223
  7988.  
  7989.   file.h,17
  7990.     Author: Bob
  7991.     Checked in: Mon, Apr 4, 1988, 10:10 AM
  7992.     Task:
  7993.  
  7994.   hdr.c,33+
  7995.     Owner: Peter
  7996.     Checked out: Tue, Apr 12, 1988, 5:58 PM
  7997.     Task: Fixing bug #333
  7998.  
  7999.   Using the -only option causes ProjectInfo to list only information
  8000.   about the project itself.
  8001.  
  8002.   ProjectInfo -only
  8003.  
  8004.   Sample∫
  8005.     Author: Bob
  8006.     Create date: Mon, Apr 4, 1988 8:20 AM
  8007.     Mod date: Thu, Apr 14, 1988, 6:00 PM
  8008.  
  8009.   Use the -f option to list filenames. Note that revision numbers are
  8010.   absent and that the file’s author and last-mod-date are listed. In
  8011.   the example below, file.c and hdr.c are currently checked out.
  8012.  
  8013.   ProjectInfo -f
  8014.  
  8015.   Sample∫
  8016.   file.c
  8017.     Author: Bob
  8018.     Create date: Mon, Apr 4, 1988, 10:00 AM
  8019.     Mod date: Tue, Apr 5, 1988, 2:15 PM
  8020.     Free: No
  8021.  
  8022.   file.h
  8023.     Author: Bob
  8024.     Create date: Mon, Apr 4, 1988, 10:00 AM
  8025.     Mod date: Mon, Apr 4, 1988, 10:00 AM
  8026.     Free: Yes
  8027.  
  8028.   hdr.c
  8029.     Author: Peter
  8030.     Create date: Mon, Apr 4, 1988, 3:30 PM
  8031.     Mod date: Mon, Apr 4, 1988, 6:00 PM
  8032.     Free: No
  8033.  
  8034.   Use the -f and -s options together to output the list of files in
  8035.   the project:
  8036.  
  8037.   ProjectInfo -f -s
  8038.  
  8039.   Sample∫
  8040.   file.c
  8041.   file.h
  8042.   hdr.c
  8043.  
  8044.   The following command will display the entire revision history of
  8045.   file.c. Note that the comment option has been included here as well.
  8046.  
  8047.   ProjectInfo -comments file.c
  8048.  
  8049.   file.c,2+
  8050.     Owner: Bob
  8051.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8052.     Task: Fixing bug #223
  8053.     Comment: COMMENT…
  8054.  
  8055.   file.c,2
  8056.     Author: Bob
  8057.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8058.     Task: Fixing bug #222
  8059.     Comment: COMMENT…
  8060.  
  8061.   file.c,1
  8062.     Author: Bob
  8063.     Checked in: Mon, Apr 4, 1988, 9:25 PM
  8064.     Task: Updating procedure comments
  8065.     Comment: COMMENT…
  8066.  
  8067.   Information about HFS files may be displayed by specifying a partial
  8068.   or full HFS pathname. This displays the information in the 'ckid'
  8069.   resource of the file.
  8070.  
  8071.   ProjectInfo :file.c
  8072.  
  8073.   :file.c,22*
  8074.     Owner: Bob
  8075.     Project: Sample∫
  8076.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8077.     Task: Fixing bug #223
  8078.  
  8079.   The asterisk (*) following the name indicates that the file is a
  8080.   modified read-only file.
  8081.  
  8082.   In the example below, only revisions created by Bob and created on
  8083.   or after April 4, 1988, are displayed.
  8084.  
  8085.   ProjectInfo -a Bob -d
  8086.  
  8087.   Sample∫
  8088.   file.c,22+
  8089.     Owner: Bob
  8090.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8091.     Task: Fixing bug #223
  8092.  
  8093.   file.c,22
  8094.     Author: Bob
  8095.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8096.     Task: Fixing bug #222
  8097.  
  8098.   file.c,21
  8099.     Author: Bob
  8100.     Checked in: Mon, Apr 4, 1988, 9:25 PM
  8101.     Task: Updating procedure comments
  8102.  
  8103.   file.h,17
  8104.     Author: Bob
  8105.     Checked in: Mon, Apr 4, 1988, 10:10 AM
  8106.     Task:
  8107.  
  8108.   In the example below, only revisions that have a task dealing with
  8109.   Bug #222 are listed.
  8110.  
  8111.   ProjectInfo -t /bug≈222/
  8112.  
  8113.   Sample∫
  8114.   file.c,22
  8115.     Author: Bob
  8116.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8117.     Task: Fixing bug #222
  8118.  
  8119.   hdr.c,31
  8120.     Author: Peter
  8121.     Checked in: Fri, Apr 1, 1988, 3:50 PM
  8122.     Task: Bug222 - Adding check procedure
  8123.  
  8124.   The final example demonstrates the -log option.
  8125.  
  8126.   ProjectInfo -log
  8127.  
  8128.   TheShell∫Projector
  8129.     7/5/88 4:07 PM
  8130.       Peter J. Potrebic
  8131.       DeleteNames Work
  8132.     7/2/88 1:37 PM
  8133.       Peter J. Potrebic
  8134.       NameRevisions Work bitmaps.a,2 ckid.c,3a2
  8135.  
  8136.   The log shows that Peter created a public name on July 2 and then
  8137.   deleted it on July 5.
  8138.  
  8139.  
  8140.                              See also 
  8141.  
  8142.   MountProject and UnmountProject.
  8143.  
  8144. æKY Quit
  8145. æC                          Quit -- quit MPW
  8146.  
  8147. Quit [-y | -n | -c]
  8148.  -y                  # save all modified windows (avoids dialog)
  8149.  -n                  # do not save any modified windows (avoids dialog)
  8150.  -c                  # cancel if a window needs to be saved (avoids dialog)
  8151.  
  8152. Status codes returned:
  8153.   1    Syntax error.
  8154.   2    Command aborted.
  8155.        Note: Quit cannot return a status of 0, because if there are no errors 
  8156.        the command never returns.
  8157.  
  8158.                            Description
  8159.  
  8160.   This command is equivalent to the menu command Quit. Quit executes
  8161.   the standard quit procedures, asking confirmation to save modified
  8162.   files, close all windows, and so on.
  8163.  
  8164.  
  8165.                              Examples
  8166.  
  8167.   Quit -y
  8168.  
  8169.   Quits MPW answering “Yes” to any dialogs such as those prompting
  8170.   to save files.
  8171.  
  8172.   Quit -c
  8173.  
  8174.   Quits MPW, unless any confirmation dialogs occur and dialog boxes
  8175.   are displayed.
  8176.  
  8177.  
  8178.                              See also 
  8179.  
  8180.   Shutdown command.
  8181.  
  8182. æKY Quote
  8183. æC             Quote -- echo parameters, quoting if needed
  8184.  
  8185. Quote [-n] [parameter…]   > parameters
  8186.  -n                      # don't write return following the parameters
  8187.  
  8188. Status codes returned:  
  8189.  0  no errors always returned.
  8190.  
  8191.                            Description
  8192.  
  8193.   Quote writes its parameters, separated by spaces and terminated by
  8194.   a return, to standard output. Parameters containing characters that
  8195.   have special meaning to the Shell’s command interpreter are quoted
  8196.   with single quotation marks. If no parameters are specified, only
  8197.   a return is written.
  8198.  
  8199.   Quote is identical to Echo except that Quote quotes parameters that
  8200.   contain special characters. Quote is especially useful when using
  8201.   Shell commands to write a script.
  8202.  
  8203.   The following special characters are quoted:
  8204.  
  8205.   Space Tab Return Null
  8206.  
  8207.   # ; & | ( ) ∂ ' " / \ { } ` ? ≈ [ ] + * « » ® < > ≥ …
  8208.  
  8209.  
  8210.                              Examples
  8211.  
  8212.   Echo ≈.a
  8213.  
  8214.   Quote ≈.a
  8215.  
  8216.   Sample.a Count.a My Program.a
  8217.  
  8218.   Sample.a Count.a 'My Program.a'
  8219.  
  8220.   Echo and Quote behave slightly differently for parameters that contain
  8221.   special characters. The first line above was produced by Echo; the
  8222.   second by Quote.
  8223.  
  8224.   Quote Notice what happens to single quotes: “--'--”
  8225.  
  8226.   Notice what happens to single quotes: '--'''--'
  8227.  
  8228.   Because single quotes can’t appear within single quotes, they are
  8229.   replaced with
  8230.  
  8231.   '' ' which closes the original single quote, adds a literal quote,
  8232.   and reopens the single quotes.
  8233.  
  8234.   For file In ≈.a
  8235.     Quote Print “{file}”
  8236.   End
  8237.   Print Sample.a
  8238.   Print Count.a
  8239.   Print 'My Program.a'
  8240.  
  8241.   The For loop shown above writes a Print command for each file that
  8242.   matches the pattern ≈.a. These commands can then be selected and
  8243.   executed. Notice the quotation marks in the last Print command.
  8244.  
  8245.  
  8246.                              See also 
  8247.  
  8248.   Echo and Parameters commands.
  8249.  
  8250. æKY Rename
  8251. æC               Rename -- rename files and directories
  8252.  
  8253. Rename [-y | -n | -c] oldName newName
  8254.  -y                      # overwrite existing file (avoids dialog)
  8255.  -n                      # don't overwrite existing file (avoids dialog)
  8256.  -c                      # cancel if conflict occurs (avoids dialog)
  8257.  
  8258. Status codes returned:
  8259.   0    Successful rename.
  8260.   1    Syntax error.
  8261.   2    Name does not exist.
  8262.   3    An error occurred.
  8263.   4    Cancel was selected or implied by the -c option.
  8264.  
  8265.                            Description
  8266.  
  8267.   The file, folder or disk specified by name is renamed newName. A
  8268.   dialog box requests a confirmation if the rename would overwrite
  8269.   an existing file or folder. The -y, -n, or -c options can be used
  8270.   to avoid this interaction.
  8271.  
  8272.     • Note: You can’t use the Rename command to change the directory
  8273.     a file is in. To do this, use the Move command.
  8274.  
  8275.     • Note also: Wildcard renames in the following form will not
  8276.     work:
  8277.  
  8278.   Rename ≈.text ≈.p
  8279.  
  8280.   This is because the Shell expands the filename patterns “≈.text”
  8281.   and “≈.p” before invoking the Rename command. In order to gain the
  8282.   desired effect, you would need to execute a command such as the one
  8283.   shown in the fifth example below.
  8284.  
  8285.  
  8286.                              Examples
  8287.  
  8288.   Rename File1 File2
  8289.  
  8290.   Changes the name of File1 to File2.
  8291.  
  8292.   Rename HD:Programs:Prog.c Prog.Backup.c
  8293.  
  8294.   Changes the name of Prog.c in the directory HD:Programs to Prog.Backup.c
  8295.   in the same directory.
  8296.  
  8297.   Rename Untitled: Backup:
  8298.  
  8299.   Changes the name of the disk Untitled to Backup.
  8300.  
  8301.   Rename -c File1 File2
  8302.  
  8303.   Changes the name of File1 to that of File2; if a conflict occurs,
  8304.   it cancels the operation and returns a status of 4.
  8305.  
  8306.   To perform a wildcard rename, you could execute the following set
  8307.   of commands:
  8308.  
  8309.   For Name In ≈.text
  8310.     ( Evaluate {Name} =~ /(≈)®1.text/ ) > Dev:Null
  8311.     Rename {Name} {®1}.p
  8312.   End
  8313.  
  8314.   The Evaluate command is executed only for its side effect of permitting
  8315.   regular expression processing. (The expression operator =~ indicates
  8316.   that the right side of the expression is a regular expression.) Thus,
  8317.   you can use the regular expression capture mechanism, (regularExpr)®n.
  8318.   Evaluate’s output is tossed in the bit bucket (Dev:Null).
  8319.  
  8320.  
  8321.                              See also 
  8322.  
  8323.   Move command.
  8324.  
  8325. æKY Replace
  8326. æC                   Replace -- replace the selection
  8327.  
  8328. Replace [-c count] selection replacement [window]
  8329.  -c count                # repeat the replace count times
  8330.  
  8331. Status codes returned:
  8332.   0    At least one instance of the selection was found.
  8333.   1    Syntax error.
  8334.   2    Any other error.
  8335.  
  8336.                            Description
  8337.  
  8338.   Replace finds selection in the specified window and replaces it with
  8339.   replacement. If no window is specified, the command operates on the
  8340.   target window (the second window from the front). It’s an error to
  8341.   specify a window that doesn’t exist. If a count is specified, the
  8342.   Replace command is repeated count times.
  8343.  
  8344.   For a definition of selection, see “Selections” in Chapter 6 of the MPW
  8345.   manual. A summary of the selection syntax is contained in Appendix B.
  8346.  
  8347.   You can include references to parts of the selection in the replacement
  8348.   by using the ® operator. The expression ®n, where n is a digit, is
  8349.   replaced with the string of characters that matches the regular expression
  8350.   tagged by ®n in the selection. (See “Tagging Regular Expressions
  8351.   With the ® Operator” in Chapter 6.)
  8352.  
  8353.   The selection is a selection expression while replacement is a string
  8354.   (that could contain the ® operator). If replacement contains spaces
  8355.   or special characters, enclose it in quotation marks.
  8356.  
  8357.   All searches are by default not case sensitive. To specify case-sensitive
  8358.   matching, set the {CaseSensitive} variable before executing the command.
  8359.  
  8360.  
  8361.                              Examples
  8362.  
  8363.   Replace -c ∞ /myVar/ 'myVariable' Prog.p
  8364.  
  8365.   Replaces every subsequent instance of the selection with the string
  8366.   in single quotation marks.
  8367.  
  8368.   Replace -c 5 /•[ ]+/ ''
  8369.  
  8370.   Strips off all the spaces and tabs at the front of the next five
  8371.   lines in the file (and replaces them with the null string). This
  8372.   action takes place in the target window.
  8373.  
  8374.   Set HexNum “[0-9A-F]+”
  8375.   Set Spaces “[ ]+”
  8376.   Replace -c ∞ /({HexNum})®1{Spaces}({HexNum})®2/ ®1 ®2
  8377.  
  8378.   Defines two variables for use in the subsequent Replace command,
  8379.   and converts a file that contains two columns of hex digits (such
  8380.   as the icon list from ResEdit) into a single column of hex digits.
  8381.  
  8382.  
  8383.                              See also 
  8384.  
  8385.   Find and Clear commands.
  8386.  
  8387.   Chapter 6.
  8388.  
  8389.   Appendix B.
  8390.  
  8391. æKY Request
  8392. æC              Request -- request text from a dialog box
  8393.  
  8394. Request [-q] [-d default] [message…] < file 
  8395.  -q                      # don't set status if user selects cancel
  8396.  -d default              # set default response
  8397.  
  8398. Status codes returned:
  8399.   0    The OK button was selected.
  8400.   1    Syntax errors.
  8401.   4    The Cancel button was selected.
  8402.  
  8403.                            Description
  8404.  
  8405.   Request displays an editable text dialog box with OK and Cancel buttons
  8406.   and the prompt message. If you select the OK button, any text you
  8407.   type into the dialog box is written to standard output. The -d option
  8408.   lets you set a default response to the request.
  8409.  
  8410.  
  8411.                              Examples
  8412.  
  8413.   Set Exit 0
  8414.   Set FileName “`Request 'File to compile' -d “{Active}”`”
  8415.   If {FileName} ≠ “”
  8416.     Pascal “{FileName}” ≥≥ “{WorkSheet}”
  8417.   End
  8418.   Set Exit 1
  8419.  
  8420.   Displays a dialog box that lets the user enter the name of a file
  8421.   to be compiled. Sets the default to be the name of the active window,
  8422.   as follows:
  8423.  
  8424. æKY ResEqual
  8425. æC           ResEqual -- compares the resources in two files
  8426.  
  8427. ResEqual [-p] File1 File2
  8428.  -p                      # write progress information to diagnostics
  8429.  
  8430. Status codes returned:
  8431.   0    Resources match.
  8432.   1    Parameter or option error.
  8433.   2    Files don’t match.
  8434.  
  8435.                            Description
  8436.  
  8437.   ResEqual compares the resources in two files and writes their differences
  8438.   to standard output.
  8439.  
  8440.   ResEqual checks that each file contains resources of the same type
  8441.   and identifier as the other file; that the size of the resources
  8442.   with the same type and identifier are the same; and that their contents
  8443.   are the same.
  8444.  
  8445.  
  8446.                              Examples
  8447.  
  8448.   Resequal Sample Sample.rsrc
  8449.  
  8450.   Compares the resources in Sample and Sample.rsrc, writing the results
  8451.   to standard output.
  8452.  
  8453.   Limitations When the contents of resources are compared and a mismatch
  8454.   is found, the mismatch and the subsequent 15 bytes are written. ResEqual
  8455.   then continues the comparison, starting with the byte following the
  8456.   last displayed.
  8457.  
  8458.   If more than ten differences are detected in the same resource, the
  8459.   rest of the resource is skipped and processing continues with the
  8460.   next resource.
  8461.  
  8462.  
  8463.                              See also 
  8464.  
  8465.   Equal command. (The -r option of Equal compares the resource forks
  8466.   of files on a byte-by-byte basis, including the resource map.)
  8467.  
  8468. æKY ResEqualIIGS
  8469. æC         ResEqualIIGS -- compares the resources in two IIGS files
  8470.  
  8471. ResEqual [-p] File1 File2
  8472.  -p                      # write progress information to diagnostics
  8473. æKY Revert
  8474. æC           Revert -- revert window to previous saved state
  8475.  
  8476. Revert [-y] [window…]
  8477.  -y                      # revert to old version (without dialog)
  8478.  
  8479. Status codes returned:
  8480.   0    No errors.
  8481.   1    Parameter or option error.
  8482.   2    The specified window does not exist.
  8483.   3    A system error occurred.
  8484.   4    The Cancel button was selected.
  8485.  
  8486.                            Description
  8487.  
  8488.   Reverts the specified windows to their previously saved states. If
  8489.   no window is specified, Revert works on the target window. Revert
  8490.   displays a confirmation dialog box, but you can avoid this dialog
  8491.   box by using the -y option to revert unconditionally to the last
  8492.   saved version of the document.
  8493.  
  8494.  
  8495.                              Examples
  8496.  
  8497.   Revert
  8498.  
  8499.   Displays a confirmation dialog box for reverting the target window
  8500.   to its last saved state.
  8501.  
  8502.   Revert -y {Worksheet}
  8503.  
  8504.   Reverts unconditionally to last saved worksheet.
  8505.  
  8506.  
  8507.                              See also 
  8508.  
  8509.   Close and Save commands.
  8510.  
  8511. æKY Rez
  8512. æC                       Rez -- resource compiler
  8513.  
  8514. Rez [option…] [file…]  < file ≥ progress
  8515.     -a[ppend]               # merge resource into output resource file
  8516.     -align word | longword  # align resource to word or longword boundries
  8517.     -c[reator] creator      # set output file creator
  8518.     -d[efine] name[=value]  # equivalent to: #define macro [value]
  8519.     -i[nclude] pathname     # path to search when looking for  #include files
  8520.     -m[odification]         # don't change the output file's modification date
  8521.     -o file                 # write output to file (default Rez.Out)
  8522.     -ov                     # ok to overwrite protected resources when appending
  8523.     -p                      # write progress information to diagnostics
  8524.     -rd                     # suppress warnings for redeclared types
  8525.     -ro                     # set the mapReadOnly flag in output
  8526.     -s[earch] pathname      # path to search when looking for INCLUDE resources
  8527.     -t[ype] type            # set output file type
  8528.     -u[ndef] name           # equivalent to: #undef name
  8529.  
  8530. Status codes returned:
  8531.   0    No errors.
  8532.   1    Error in parameters.
  8533.   2    Syntax error in file.
  8534.   3    I/O or program error.
  8535.  
  8536.                            Description
  8537.  
  8538.   Rez compiles the resource fork of a file according to a textual description.
  8539.   The resource description file is a text file that has the same format
  8540.   as the output produced by DeRez, the resource decompiler. The data
  8541.   used to build the resource file can come directly from the resource
  8542.   description file(s) as well as from other text files (via #include
  8543.   and read directives in the resource description file) and from other
  8544.   resource files (via the include directive).
  8545.  
  8546.   Rez includes macro processing, full expression evaluation, and built-in
  8547.   functions and system variables. For information about Rez and the
  8548.   format of a resource description file, see Chapter 11 of the MPW manual. 
  8549.   For a summary of the format of a resource description file, see Appendix D.
  8550.  
  8551.  
  8552.                              Examples
  8553.  
  8554.   Rez Types.r Sample.r -o Sample
  8555.  
  8556.   Generates a resource fork for the file Sample, based on the descriptions
  8557.   in Types.r and Sample.r.
  8558.  
  8559.  
  8560.                              See also 
  8561.  
  8562.   DeRez and RezDet commands.
  8563.  
  8564.   Chapter 11 and Appendix D.
  8565.  
  8566.   Standard resource type declarations in the directory {RIncludes}:
  8567.  
  8568.     • Types.r
  8569.  
  8570.     • SysTypes.r
  8571.  
  8572.     • MPWTypes.r
  8573.  
  8574.     • Pict.r
  8575.  
  8576. æKY RezDet
  8577. æC            RezDet -- detect inconsistencies in resources
  8578.  
  8579. RezDet [option…] file…   > dump
  8580.  -b[ig]                  # read resources one at a time, not all at once
  8581.  -d[ump]                 # write -show information, plus headers, lists, etc.
  8582.  -l[ist]                 # write list of resources with minimum information
  8583.  -q[uiet]                # don't write any output, just set {Status}
  8584.  -r[awdump]              # write -dump information plus contents
  8585.  -s[how]                 # write information about each resource
  8586.  
  8587.  Note: Use at most one of -quiet, -list, -show, -dump, and -rawdump.
  8588.  
  8589. Status codes returned:
  8590.   0    No errors detected.
  8591.   1    Invalid options or no files specified.
  8592.   2    Resource format error detected.
  8593.   3    Fatal error—an I/O or program error was detected.
  8594.  
  8595.                            Description
  8596.  
  8597.   If no options are specified, RezDet investigates the resource fork
  8598.   of each file for damage or inconsistencies. The specified files are
  8599.   read and checked one by one. Output is generated according to the
  8600.   options specified.
  8601.  
  8602.   RezDet checks for the following conditions:
  8603.  
  8604.     • The resource fork is at least the minimum size. (There must
  8605.     be enough bytes to read a resource header.)
  8606.  
  8607.     • There is no overlap or space between the header, the resource
  8608.     data list, and the resource map. There should be no bytes between
  8609.     the EOF and the end of the resource map.
  8610.  
  8611.     • Each record in the resource data list is used once and only
  8612.     once. The last data item ends exactly where the data list ends.
  8613.  
  8614.     • Each item in the resource type list contains at least one reference;
  8615.     each sequence of referenced items starts where the previous resource
  8616.     type item’s reference list ended; and each item in the reference
  8617.     list is pointed to by one and only one resource type list item.
  8618.  
  8619.     • There are no duplicates in the resource type list.
  8620.  
  8621.     • Each name in the name list has one and only one reference,
  8622.     and the last name doesn’t point outside the name list.
  8623.  
  8624.     • There are no duplicate names in the name list. Duplicate names
  8625.     cause an advisory warning rather than a true error. This warning
  8626.     is given only if the -s, -d, or -r option is selected.
  8627.  
  8628.     • Each reference list item points to a valid data item and either
  8629.     has a name list offset of –1 or points to a valid name list offset.
  8630.  
  8631.     • Bits 7 (Unused), 1 (Changed), or 0 (Unused) should not be set
  8632.     in the resource attributes.
  8633.  
  8634.     • All names have a nonzero length.
  8635.  
  8636.   Fields are displayed as hexadecimal or decimal for numeric values,
  8637.   or as a hex dump with associated printable Macintosh characters.
  8638.   The characters newline ($0D), tab ($09) and null ($00) are displayed
  8639.   as “¬”, “Δ”, and “.”, respectively.
  8640.  
  8641.     • Note: RezDet does not use the Resource Manager and should not
  8642.     crash, no matter how corrupt the resource fork of the file.
  8643.  
  8644.  
  8645.                              Examples
  8646.  
  8647.   RezDet {SystemFolder}System
  8648.  
  8649.   Checks the System file for damage.
  8650.  
  8651.   RezDet -q Foo || Delete Foo
  8652.  
  8653.   Removes the file Foo if the resource fork is damaged.
  8654.  
  8655.   Limitations Duplicate resource name warnings are generated even if
  8656.   the names belong to resources of different types.
  8657.  
  8658.   The file attributes field in the resource map header is not validated.
  8659.  
  8660.   The Finder-specific fields in the header and resource map header
  8661.   are ignored.
  8662.  
  8663. æKY RezIIGS
  8664. æC                    RezIIGS -- resource compiler
  8665. RezIIGS [option…] [file…]  < file ≥ progress
  8666.  -c[reator] creator      # set output file creator
  8667.  -d[efine] name[=value]  # equivalent to: #define macro [value]
  8668.  -f[lag] SYSTEM | ROM    # set resource file attributes
  8669.  -i[nclude] pathname     # path to search when looking for  #include files
  8670.  -m[odification]         # don't change the output file's modification date
  8671.  -o file                 # write output to file (default RezIIGS.out)
  8672.  -p                      # write progress information to diagnostics
  8673.  -rd                     # suppress warnings for redeclared types
  8674.  -ro                     # set the mapReadOnly flag in output
  8675.  -s[earch] pathname      # path to search when looking for INCLUDE resources
  8676.  -t[ype] type            # set output file type
  8677.  -u[ndef] name           # equivalent to: #undef name
  8678.  
  8679. æKY RotateWindows
  8680. æC       RotateWindows -- send active (frontmost) window to back
  8681.  
  8682. RotateWindows [-r]
  8683.  -r                      # reverse rotation; bring bottom window to front
  8684.  
  8685. Status codes returned:
  8686.   0    No errors.
  8687.   1    Syntax error (error in parameters).
  8688.  
  8689.                            Description
  8690.  
  8691.   RotateWindows places the front MPW window in the back and brings
  8692.   the second window to the front. Multiple calls to RotateWindows rotate
  8693.   through all open MPW windows. RotateWindows brings only MPW windows
  8694.   to the front (desk accessory windows are not rotated). You might
  8695.   want to add this command to a menu, along with a command key equivalent.
  8696.   For example:
  8697.  
  8698.   AddMenu 'Extras' 'RotateWindows/®' 'RotateWindows'
  8699.  
  8700.  
  8701.                              Examples
  8702.  
  8703.   RotateWindows
  8704.  
  8705.   Puts the front MPW window in back, and brings the target MPW window
  8706.   to the front.
  8707.  
  8708.  
  8709.                              See also 
  8710.  
  8711.   StackWindows, SizeWindow, MoveWindow, and ZoomWindow commands.
  8712.  
  8713. æKY Save
  8714. æC                    Save -- save specified windows
  8715.  
  8716. Save [-a | window…]
  8717.  -a                      # save the contents of all windows
  8718.  
  8719. Status codes returned:
  8720.   0    No errors.
  8721.   1    Syntax error.
  8722.   2    Specified window does not exist.
  8723.  
  8724.                            Description
  8725.  
  8726.   Saves the contents of window or a list of windows to disk without
  8727.   closing them. The -a option saves all open windows. Save without
  8728.   any parameters saves the target window (the second window from the
  8729.   front).
  8730.  
  8731.  
  8732.                              Examples
  8733.  
  8734.   Save -a
  8735.  
  8736.   Saves all open windows.
  8737.  
  8738.   Save {Active} {Worksheet}
  8739.  
  8740.   Saves the Worksheet window and the contents of the active window.
  8741.  
  8742.  
  8743.                              See also 
  8744.  
  8745.   Close and Revert commands.
  8746.         
  8747. æKY SaveOnClose
  8748. æC                    SaveOnClose -- set save behavior when closing windows
  8749.  
  8750. SaveOnClose [-a | -d | -n] [window…]
  8751.  -a                  # always save upon close ("Close -y")
  8752.  -d                  # default behavior for Close
  8753.  -n                  # never save upon close ("Close -n")
  8754.  
  8755.                            Description
  8756.                                                                                                             
  8757. This command selects an automatic behavior: save, do not save, or ask
  8758. whether to save when closing a window.  The -n option does not turn off 
  8759. the Save menu item, allowing the user to request saving explicitly. 
  8760.                                                                                                     
  8761.  
  8762. æKY Search
  8763. æC                  Search -- search files for pattern
  8764.  
  8765. Search [-b] [-s | -i] [-nf] [-r] [-q] [-f file] pattern [file…] < file > found
  8766.  -b                  # break "File/Line" from matched pattern
  8767.  -i                  # case insensitive search (overriding {CaseSensitive})
  8768.  -s                  # case sensitive search (overriding {CaseSensitive})
  8769.  -nf                 # write "pattern not found" to standard error and set status = 2
  8770.  -r                  # write non-matching line to standard output
  8771.  -q                  # suppress file name and line number in output
  8772.  -f file             # lines not written to output are put in this file
  8773.  
  8774. Status codes returned:
  8775.   0    No error.
  8776.   1    Syntax error.
  8777.   2    Pattern not found.
  8778.  
  8779.                            Description
  8780.  
  8781.   Searches the input files for lines that contain a pattern and writes
  8782.   those lines to standard output. If no file is given, standard input
  8783.   is searched. When reading from files, the filenames and line numbers
  8784.   of matching lines are prepended to each line of output.
  8785.  
  8786.   Pattern (defined in “Pattern Matching” in Chapter 6 of the MPW manual and 
  8787.   in Appendix B) is a regular expression, optionally enclosed in forward 
  8788.   slashes ( / ).
  8789.  
  8790.  
  8791.                              Examples
  8792.  
  8793.   Search /procedure/ Sample.p
  8794.  
  8795.   Searches the file Sample.p for the pattern “procedure”. All lines
  8796.   containing this pattern are written to standard output.
  8797.  
  8798.   Search /Export/ {MPW}StartUp {MPW}UserStartUp
  8799.  
  8800.   Lists the Export commands in the StartUp and UserStartup files.
  8801.  
  8802.   Search /PROCEDURE [a-zA-Z0-9_]*;/ {PInterfaces}≈
  8803.  
  8804.   Searches for the procedures with no parameters in the Pascal interface
  8805.   files supplied with MPW Pascal. Because more than one input file
  8806.   is specified, a filename will precede each line in the output.
  8807.  
  8808.   Search -f file.nonmatch /pattern/ file
  8809.  
  8810.   All lines of “file” that contain “pattern” are written to standard
  8811.   output. All other lines will be placed in file.nonmatch. This, in
  8812.   effect, splits the file in two pieces, using “pattern” as the key.
  8813.  
  8814.   Search -r -f file.nonmatch /pattern/ file
  8815.  
  8816.   This does the opposite of the preceding example. All lines that do
  8817.   not contain “pattern” are echoed to standard output, and all other
  8818.   lines (that is, those containing “pattern”) are written to file.nonmatch.
  8819.  
  8820.  
  8821.                              See also 
  8822.  
  8823.   Find command.
  8824.  
  8825.   “Pattern Matching (Using Regular Expressions)” in Chapter 6.
  8826.  
  8827. æKY Set
  8828. æC               Set -- define or write Shell variables
  8829.  
  8830. Set [name [value]]   > variableList
  8831.  
  8832. Status codes returned:
  8833.   0    No error.
  8834.   1    Syntax error.
  8835.   2    Variable “name” does not exist.
  8836.  
  8837.                            Description
  8838.  
  8839.   Set assigns the string value to the variable name. If value is omitted,
  8840.   Set writes the name and its current value to standard output. If
  8841.   both name and value are omitted, Set writes a list of all variables
  8842.   and their values to standard output. (This output is in the form
  8843.   of Set commands.)
  8844.  
  8845.     • Note: To make variable definitions available to enclosed scripts
  8846.     and programs, you must use the Export command.
  8847.  
  8848.  
  8849.                              Examples
  8850.  
  8851.   Set CIncludes “{MPW}CFiles:CIncludes:”
  8852.  
  8853.   Redefines the variable CIncludes.
  8854.  
  8855.   Set CIncludes
  8856.  
  8857.   Displays the new definition of CIncludes.
  8858.  
  8859.   Set Commands ∂
  8860.   “:,{MPW}Tools:,{MPW}Applications:,{MPW}ShellScripts:”
  8861.  
  8862.   Redefines the variable {Commands} to include the directory “{MPW}ShellScripts:”.
  8863.   (See Chapter 5 for a complete list of predefined variables.)
  8864.  
  8865.   Set > SavedVariables
  8866.   # ... other commands
  8867.   Execute SavedVariables
  8868.  
  8869.   Writes the values of all variables to file SavedVariables. Because
  8870.   the output of Set is actually Set commands, the file can be executed
  8871.   later to restore the saved variable definitions. This technique is
  8872.   used in the Suspend and Resume scripts to save and restore variable
  8873.   definitions, as well as exports, aliases, and menus.
  8874.  
  8875.  
  8876.                              See also 
  8877.  
  8878.   Export, Unexport, and Unset commands.
  8879.  
  8880.   “Defining and Redefining Variables” in Chapter 5.
  8881.  
  8882.   “The Startup and UserStartup Files” in Chapter 5.
  8883.  
  8884. æKY SetDirectory
  8885. æC             SetDirectory -- set the default directory
  8886.  
  8887. SetDirectory directory
  8888.  
  8889. Status codes returned:
  8890.   0    Successful completion.
  8891.   1    Parameter error or unable to set directory.
  8892.  
  8893.                            Description
  8894.  
  8895.   SetDirectory sets the default directory and adds the new default
  8896.   directory to the Directory menu if it is not already present. The
  8897.   directory parameter must be specified.
  8898.  
  8899.     • Note: Directory names should not contain any of the special
  8900.     characters shown below. These characters all have special meaning
  8901.     when they appear in menu items:
  8902.  
  8903.   - ; ^ ! < / (
  8904.  
  8905.   The SetDirectory script is used to implement the Set Directory menu
  8906.   item in the Directory menu.
  8907.  
  8908.  
  8909.                              Examples
  8910.  
  8911.   SetDirectory {MPW}Scripts:
  8912.  
  8913.   Sets the default directory to the Scripts folder in the {MPW} directory
  8914.   and adds {MPW}Scripts: to the Directory menu if it’s not already
  8915.   there.
  8916.  
  8917.   SetDirectory…
  8918.  
  8919.   Uses the Commando dialog box to select the default directory interactively.
  8920.  
  8921.  
  8922.                              See also 
  8923.  
  8924.   Directory, DirectoryMenu, and Files commands.
  8925.  
  8926. æKY SetFile
  8927. æC                   SetFile -- set file/folder attributes
  8928.  
  8929. SetFile [option…] file/folder…
  8930.  -a attributes         # attributes (lowercase = 0, uppercase = 1)
  8931.  -c creator            # file creator
  8932.  -d date               # creation date (mm/dd/yy [hh:mm[:ss] [AM | PM]])*
  8933.  -l h,v                # ICON location (horizontal,vertical)*
  8934.  -m date               # modification date (mm/dd/yy [hh:mm[:ss] [AM | PM]])*
  8935.  -t type               # file type
  8936.  
  8937.  Note: Period (.) represents the current date and time.
  8938.  Note: The following attributes may be used with the -a option:
  8939.      L   Locked
  8940.      V   Invisible*
  8941.      B   Bundle
  8942.      S   System
  8943.      I   Inited*
  8944.      D   Desktop*
  8945.      M   Shared (can run multiple times)
  8946.      A   Always switch launch (if possible)
  8947. *Note: Options/attributes marked with an asterisk (*) are allowed with folders
  8948.  
  8949. Status codes returned:
  8950.   0    The attributes for all files were set.
  8951.   1    Syntax error.
  8952.   2    An error occurred.
  8953.       
  8954.  
  8955.                            Description
  8956.  
  8957.   Sets attributes for one or more files. The options apply to all files
  8958.   listed.
  8959.  
  8960.  
  8961.                              Examples
  8962.  
  8963.   SetFile -c “MPS ” -t MPST ResEqual
  8964.  
  8965.   Sets the creator and type for the MPW Pascal tool ResEqual.
  8966.  
  8967.   SetFile Foo -m “2/15/86 2:25”
  8968.  
  8969.   Sets the modification date of file Foo.
  8970.  
  8971.   SetFile Foo Bar -m .
  8972.  
  8973.   Sets the modification date to the current date and time (the period
  8974.   is a parameter to -m, indicating current date and time). Setting
  8975.   the date is useful, for instance, before running Make.
  8976.  
  8977.  
  8978.                              See also 
  8979.  
  8980.   Files command. (The -l and -x options display file information.)
  8981.  
  8982. æKY SetPrivilege
  8983. æC  SetPrivilege -- set access privileges for directories on file servers
  8984.  
  8985. SetPrivilege [option…] directory…  > information
  8986.     -d privileges           # set privileges for seeing directories
  8987.     -f privileges           # set privileges for seeing files
  8988.     -g group                # make the directories belong to group
  8989.     -i                      # return information on directories
  8990.     -m privileges           # set privileges for making changes
  8991.     -o owner                # make owner the owner of directories
  8992.     -r                      # operate (set or list) recursively
  8993.  
  8994.     Note: The following privilege characters may be used with
  8995.     the -d, -f, or -m options (Upper case enables the privilege,
  8996.     lower case disables it):
  8997.          O   Owner
  8998.          G   Group
  8999.          E   Everyone
  9000.  
  9001. Status codes returned:
  9002.   0    No error.
  9003.   1    Syntax error.
  9004.   2    Folder not found, or folder not an AppleShare folder.
  9005.   3    User is not owner; could not modify privileges.
  9006.  
  9007.                            Description
  9008.  
  9009.   Using SetPrivilege is equivalent to using the access privileges desk
  9010.   accessory. Priv is a character string (one, two or three characters
  9011.   long) that specifies privileges for the owner, the group, and everyone
  9012.   (o, g, and e, respectively). An uppercase letter enables the privilege;
  9013.   a lowercase letter disables the privilege. If a specific character
  9014.   is not in the string, the respective privilege is not changed.
  9015.  
  9016.  
  9017.                              Examples
  9018.  
  9019.   SetPrivilege -r -f OGe -d OGe -m Oge ∂
  9020.   “Server:personal:peter”
  9021.  
  9022.   This gives everyone in your group the ability to see files within
  9023.   Server:personal:peter without being able to change them. Anyone outside
  9024.   the group cannot see the files or folders or make changes. The owner
  9025.   can do everything.
  9026.  
  9027.   Here is the easiest way to use the SetPrivilege command: Use the
  9028.   -i option to get information on folders and edit the privileges as
  9029.   desired. Then execute the resulting command. For example, to change
  9030.   the privileges for Server:Private, follow these steps:
  9031.  
  9032.   1. Execute this command to obtain the current privileges:
  9033.  
  9034.   SetPrivilege -i Server:Private
  9035.  
  9036.   SetPrivilege Server:Private -o Joe -g Team -d OGE -f OGE -m OGE
  9037.  
  9038.     • Note: These privileges show that Joe, the group Team, and everyone
  9039.     else has all privileges to the folder Private.
  9040.  
  9041.   2. Now edit the output, adjusting the privileges as desired. For
  9042.   example,
  9043.  
  9044.   SetPrivilege Server:Private -o Joe -g Team -d Oge -f Oge -m Oge
  9045.  
  9046.     • Note: Now only Joe, the owner, can see directories and files.
  9047.     Only Joe can make changes; all other users have no privileges.
  9048.  
  9049.   3. Execute the resulting command.
  9050.  
  9051. æKY SetVersion
  9052. æC          SetVersion -- maintain version and revision number
  9053.  
  9054. SetVersion [option…] file  > output ≥ progress
  9055.  -b                    # increment the bug fix component by 1
  9056.  -country name         # country code name
  9057.  -csource file         # update the #define Version string in C source
  9058.  -d                    # display (updated) version numbers to standard output
  9059.  -fmt nƒ.mƒ            # format version numbers according to specification
  9060.  -i resid              # use specified resource id instead of 0
  9061.  -p                    # write SetVersion's version info to diagnostic file
  9062.  -prefix prefix        # prefix version with specified prefix
  9063.  -[p]source file       # update the Version string constant in Pascal source
  9064.  -r                    # increment the revision component by 1
  9065.  -rezsource file       # update the resource definition in Rez source
  9066.  -sb bugfix            # set the bug fix component to the specified value
  9067.  -sr revision          # set the revision component to the specified value
  9068.  -stage stage          # set release stage for a 'vers' resource
  9069.  -suffix suffix        # suffix the version with specified suffix
  9070.  -sv version           # set the version component to the specified value
  9071.  -sx nonrel            # set the non-release component to the specified value
  9072.  -sync 1 | 2           # synchronize 'vers',1 with 'vers',2 or vice versa
  9073.  -t type               # use specified resource type
  9074.  -v                    # increment the version component by 1
  9075.  -verid identifier     # use C/Pascal source version id instead of "Version"
  9076.  -version fmtstring    # alternate way of specifying version component actions
  9077.  -verstring longstring # set the long version string of a Finder 'vers' resource
  9078.  -x                    # increment the non-release component by 1
  9079.  
  9080. Status codes returned:
  9081.   0    Normal termination.
  9082.   1    Parameter or option error.
  9083.  
  9084.                            Description
  9085.  
  9086.   SetVersion generates and maintains (sets or increments) the individual
  9087.   components making up a version number for a file. There are two forms
  9088.   of version numbering supported by SetVersion:
  9089.  
  9090.   ver.rev The first version numbering form is “ver.rev”, where ver
  9091.   is a version number and rev a revision number. The component values
  9092.   are kept in a private resource generated and maintained by SetVersion
  9093.   itself. The resource is generally used only by applications (for
  9094.   example, in their About box) and MPW tools (for example, when an
  9095.   MPW tool’s -p option is used) that contain code to read the resource.
  9096.   It is also recognized by Commando to be displayed just below the
  9097.   Do It button of a Commando dialog box1.
  9098.  
  9099.   In this form of version numbering, the resource is maintained as
  9100.   a Pascal string with the resource type 'MPST' and a resource ID of
  9101.   0 (you can use the -t and -i options to specify another resource
  9102.   type and ID number if desired). The resource has the following layout
  9103.   (described as Rez input):
  9104.  
  9105.  
  9106.                              Examples
  9107.  
  9108.   setversion -d -sv 1 -r Example -psource Globals -rezsource Example.r
  9109.  
  9110.   The MPW tool Example contains a SetVersion 'MPST' string resource.
  9111.   The above command line increments the revision for the tool (-r)
  9112.   in the resource fork of the file Example. The version is fixed at
  9113.   1 (-sv), so that Example displays the version and revision as “1.rev”.
  9114.   The Pascal include file, Globals, contains the tool’s global declarations,
  9115.   including the Version string. This include file is updated to match
  9116.   the 'MPST' resource (-psource). The resource definitions for the
  9117.   tools, in Example.r, will be similarly updated (-rezsource). Finally,
  9118.   this command displays the new version of the standard output file
  9119.   (-d).
  9120.  
  9121.   setversion -d -version 1.Δ Example -psource Globals -rezsource Example.r
  9122.  
  9123.   Same as previous example, but here we illustrate how the -version
  9124.   option serves the same purpose as the -sv and -r options. Here the
  9125.   “Δ” indicates that the revision is to be incremented.
  9126.  
  9127.   setversion -d -version 1.2.%bΔ Example -psource Globals ∂
  9128.   -rezsource Example.r
  9129.  
  9130.   Again an 'MPST' SetVersion string resource is to be generated. But
  9131.   here we use a more complex version number. The version is set to
  9132.   1, the revision to 2, the bug fix level is left alone (“%”), this
  9133.   is a beta (b) release, and finally the nonrelease level is to be
  9134.   incremented.
  9135.  
  9136.   SetVersion SetVersion -psource SetVersion.p -version 3.Δ -t vers -i 1 ∂
  9137.   -d -verstring “^, ©Apple Computer, Inc. 1984-1988, by Ira L. Ruben”
  9138.  
  9139.   SetVersion SetVersion -version 3.0b1 -t vers -i 2 -verstring “MPW
  9140.   3.0b1”
  9141.  
  9142.   This pair of SetVersion commands generates both Finder 'vers',1 and
  9143.   'vers',2 resources. The Finder Get Info display shown earlier illustrates
  9144.   the result of using these commands. The MPW tool, SetVersion, has
  9145.   its own version number, 3.Δ (the revision is incremented for version
  9146.   3) set as a 'vers',1 resource (-t 'vers', -i 1). A long version message
  9147.   is specified by the -verstring option. The version number from the
  9148.   short message string is inserted into the long string at the position
  9149.   indicated by the “^” character. The generated version number is displayed
  9150.   to the standard output (-d) file. It is also used to update the Pascal
  9151.   source file constant (-psource).
  9152.  
  9153.   The second SetVersion command set the 'vers',2 resource (-t 'vers',
  9154.   -i 2). The version is set unconditionally to 3.0b1 and the long message
  9155.   string to “MPW 3.0b1”. MPW 3.0b1 is the MPW release, and SetVersion
  9156.   is just one of the files that belong to this release.
  9157.  
  9158.   The last example illustrates how both 'vers' resources should be
  9159.   used. The 'vers',1 resource is the individual file version while
  9160.   the 'vers',2 is the version release of a product that “owns” the
  9161.   file. The last example also should give some idea of how to arrange
  9162.   makefiles, specifically makefile macro definitions, to make the version
  9163.   numbering automatic and general. The following example illustrates
  9164.   this. It is the actual macro definitions and the SetVersion calls
  9165.   used to build SetVersion itself. They are taken as is from SetVersion’s
  9166.   makefile.
  9167.  
  9168.   MPWversion = 3.0b1                # product release version
  9169.   Copyright = ©Apple Computer, Inc. # copyright notice
  9170.   ver2 = MPW {MPWversion}           # long msg string for 'ver',2
  9171.   ver1 = ^, {Copyright}             # long msg string for 'ver',1
  9172.   - - -
  9173.  
  9174.   SetVersionVer = -sv 3 -r          # SetVersion's component controls
  9175.   Stage = -stage rel -sb 0          # Stage used by tools in makefile
  9176.   - - -
  9177.  
  9178.   SetVersion {LinkedTools}SetVersion -psource {ToolsDir}SetVersion.p ∂
  9179.   {SetVersionVer} -t vers -i 1 {stage} -d ∂
  9180.                   -verstring “{ver1} 1984-1988, by Ira L. Ruben”
  9181.  
  9182.   SetVersion {LinkedTools}SetVersion -version {MPWversion} -t vers ∂
  9183.              -i 2 -verstring “{ver2}”
  9184.   - - -
  9185.  
  9186.   The macro definitions specify the common aspects of the build; that
  9187.   is,
  9188.  
  9189.     • {MPWVersion}—the MPW release (which can be changed by a Make -d
  9190.     option when Make is called).
  9191.  
  9192.     • {Copyright}—the copyright string (which is concatenated into
  9193.     the 'vers',1 long message string).
  9194.  
  9195.     • {ver1}—the long string for the 'vers',2 resource (note it uses
  9196.     the MPW release string—we could have used a “^” here), which
  9197.     is to be displayed at the top of the Finder’s Get Info window.
  9198.  
  9199.     • {ver2}—the long string for the 'vers',1 resource (here we do
  9200.     use the “^”), which is to be displayed as the tools’ individual
  9201.     version number (we use only version and revision numbers).
  9202.  
  9203.     • {SetVersionVer}—a macro that defines the numbering control
  9204.     for the individual tool (the makefile is used to make other tools
  9205.     so there is one of these for each individual tool made).
  9206.  
  9207.     • {Stage}—Used just to insure that only ver.rel is generated
  9208.     in the 'vers',1 resource.
  9209.  
  9210.   The two SetVersion calls are similar to the previous example, but
  9211.   here they are part of a makefile, and we use the macros.
  9212.  
  9213.   1 Commando only uses the SetVersion string resource if a “VersionDialog”
  9214.   is specified as part of the Commando resources. If omitted, Commando
  9215.   will look for a 'vers' resource(s).
  9216.  
  9217.   2 When Commando uses a 'vers' resource, it first will look for a
  9218.   'vers' ,1 resource, and if not present, a 'vers' ,2 resource. The
  9219.   short version string is displayed below the Do It button. Clicking
  9220.   this version number causes the long version string to be displayed
  9221.   in the “help” box. The two 'vers' resources as well as the strings
  9222.   they contain are described when the 'vers' resource format is described.
  9223.  
  9224.   3 The comparison of the BCD field is only valid if the version number
  9225.   components don’t exceed the limitations imposed by the resource.
  9226.   Specifically, the version and nonrelease values are limited to two
  9227.   BCD digits, while the revision and bug fix values are limited to
  9228.   one digit. Because of these limitations, SetVersion does not use
  9229.   the BCD value. SetVersion does, however, place the low-order digits
  9230.   of the actual version components (maintained in the short message)
  9231.   into the BCD fields. The BCD field is thus valid until the version
  9232.   counts exceed the corresponding BCD limitations.
  9233.  
  9234.   4 See the -t option for a summary of which options are valid as a
  9235.   function of which resource (SetVersion’s string or Finder’s 'vers'
  9236.   resource) is being manipulated.
  9237.  
  9238.   5 The country names are spelled exactly as specified in Inside Macintosh
  9239.   for the International Utilities.
  9240.  
  9241. æKY Shift
  9242. æC         Shift -- renumber command file positional parameters
  9243.  
  9244. Shift [number]
  9245.  
  9246. Status codes returned:
  9247.   0    Success.
  9248.   1    Syntax error.
  9249.  
  9250.                            Description
  9251.  
  9252.   Shift renames the command script positional parameters {number+1},
  9253.   {number+2}… to {1}, {2}, and so on. If number is not specified, the
  9254.   default value is 1. Parameter 0 (the command name) is not affected.
  9255.   The variables {Parameters}, {Parameters}, and {#} variables are also
  9256.   modified to reflect the new parameters.
  9257.  
  9258.  
  9259.                              Examples
  9260.  
  9261.   The following script repeats a command once for each parameter:
  9262.  
  9263.   ### Repeat - Repeat a command for several parameters ###
  9264.   #
  9265.   #         Repeat command parameter…
  9266.   #         Execute command once for each parameter in the
  9267.   #         parameter list. You can specify options by
  9268.   #         including them in quotes with the command name.
  9269.   #
  9270.   Set d {1}
  9271.   Loop
  9272.     Shift
  9273.     Break If {1} == ""
  9274.     {cmd} "{1}"
  9275.   End
  9276.  
  9277.   In the preceding example, the Shift command is used to step through
  9278.   the parameters. The Break command tells the loop when all the parameters
  9279.   have been used. You might, for example, use the following Repeat
  9280.   script to compile several C programs with progress information:
  9281.  
  9282.   Repeat 'C -p' Sample.c Count.c Memory.c
  9283.  
  9284.  
  9285.                              See also 
  9286.  
  9287.   “Parameters” in Chapter 5.
  9288.         
  9289. æKY ShowSelection
  9290. æC          ShowSelection -- place the selection within an editor window
  9291.  
  9292. ShowSelection [-t | -b | -c | -n lines | -l line] [window]
  9293.  -t                   # place first line of selection at top of window
  9294.     -b                   # place first line of selection at bottom of window
  9295.     -c                   # center the first line within the window
  9296.     -n lines             # place first line of selection lines from the top
  9297.     -l line              # place line at the top of window
  9298.  
  9299. æKY Shutdown
  9300. æC             Shutdown -- power down or restart the machine
  9301.  
  9302. Shutdown [-y | -n | -c] [-r]
  9303.  -y                  # save all modified windows (avoids dialog)
  9304.  -n                  # do not save any modified windows (avoids dialog)
  9305.  -c                  # cancel if a window needs to be saved (avoids dialog)
  9306.  -r                  # restart the machine
  9307.  
  9308. Status codes returned:
  9309.   1    Syntax error.
  9310.   2    Command aborted.
  9311.        Note: Shutdown cannot return a status of 0 because if there are no 
  9312.        errors the command never returns.
  9313.  
  9314.                            Description
  9315.  
  9316.   Shutdown quits MPW and then either shuts down or reboots the Macintosh.
  9317.   The default is shutdown. Before rebooting the computer, the system
  9318.   executes standard quit procedures, asking for confirmation to save
  9319.   modified files, close all windows, and so on.
  9320.  
  9321.     • Note: Under MultiFinder, Shutdown does not give other active
  9322.     applications the chance to save their documents.
  9323.  
  9324.  
  9325.                              Examples
  9326.  
  9327.   Shutdown -y
  9328.  
  9329.   Shuts down the machine, answering “Yes” to any dialogs such as those
  9330.   prompting to save files.
  9331.  
  9332.  
  9333.                              See also 
  9334.  
  9335.   Quit command.
  9336.  
  9337. æKY SizeWindow
  9338. æC                  SizeWindow -- set a window's size
  9339.  
  9340. SizeWindow  [h v] [window]
  9341.  h                       # window width (horizontal)
  9342.  v                       # window height (vertical)
  9343.  
  9344. Status codes returned:
  9345.   0    No errors.
  9346.   1    Syntax error (error in parameters).
  9347.   2    The specified window does not exist.
  9348.   3    The h v size specified is too big.
  9349.  
  9350.                            Description
  9351.  
  9352.   Sets the size of the specified window to be h by v pixels, where
  9353.   h and v are nonnegative integers referring to the horizontal and
  9354.   vertical dimensions, in that order. (Use a blank space to separate
  9355.   the numbers h and v on the command line.) The default window is the
  9356.   target (second from the front) window; a specific window can optionally
  9357.   be specified. If the size specified would cause the window to be
  9358.   too big for the screen, an error is returned.
  9359.  
  9360.  
  9361.                              Examples
  9362.  
  9363.   SizeWindow 200 200
  9364.  
  9365.   Makes the target window 200 pixels square in size.
  9366.  
  9367.   SizeWindow {Active}
  9368.  
  9369.   A SizeWindow command with no parameters displays the size of the
  9370.   specified window:
  9371.  
  9372.   SizeWindow 500 100 {Worksheet}
  9373.  
  9374.   Makes the Worksheet window 500 x 100 pixels in size.
  9375.  
  9376.  
  9377.                              See also 
  9378.  
  9379.   MoveWindow, RotateWindows, StackWindows, TileWindows, and ZoomWindow
  9380.   commands.
  9381.  
  9382. æKY Sort
  9383. æC                  Sort -- sort or merge lines of text
  9384.  
  9385. Sort [option…] [files…]
  9386.  -b                      # skip leading blanks of each field
  9387.  -check                  # check if input is sorted (exit code 5 if not).
  9388.  -d                      # sort fields as decimal numbers
  9389.  -f field[,field]        # specify fields to sort on (see below)
  9390.  -fs string              # specify field separator characters
  9391.  -l                      # convert to lowercase before comparison
  9392.  -merge                  # merge pre-sorted input files
  9393.  -o file                 # specify output file, allows sorting-in-place
  9394.  -p                      # print version and progress information
  9395.  -quote                  # handle fields with quotes
  9396.  -stdin                  # place-holder for standard input (acts like a file)
  9397.  -r                      # reverse order of comparison
  9398.  -t                      # sort fields as text (default)
  9399.  -u                      # convert to uppercase before comparison
  9400.  -unique                 # write only unique output lines
  9401.  -x                      # sort fields as hexadecimal numbers (leading '$'
  9402.                          #   or '0x' is ignored)
  9403.  
  9404.  The comma-separated field specifications (following -f) take the forms:
  9405.  
  9406.          [F][.C][-K][bdlqrtux]
  9407.      or  [F][.C][+N][bdlqrtux]
  9408.  
  9409.  'F' is a field number (0=whole line [default], 1=first word, 2=second word…).
  9410.  'C' is the starting column number (from 1), default=1.
  9411.  'K' is the ending column number >= C, default=infinite.
  9412.  'N' is the maximum number of characters in the field, default=infinite.
  9413.  Only one of '-K' or '+N' can be specified.
  9414.  
  9415.  The local modifier characters 'bdlqrtux' have the same meaning on a
  9416.  per-field basis as -b, -d, -l, -q, -r, -t, -u and -x (which take effect
  9417.  globally).
  9418.  
  9419. Status codes returned:
  9420.   0    No errors.
  9421.   1    Syntax error on command line.
  9422.   2    Any other error.
  9423.   4    Out of memory.
  9424.   5    Input is not sorted.
  9425.  
  9426.                            Description
  9427.  
  9428.   Sort sorts or merges the specified files and prints the result on
  9429.   the standard output. If no input files are specified, standard input
  9430.   is assumed.
  9431.  
  9432.   Fields and Field Specifications
  9433.  
  9434.   The -f option (see “Options” ) precedes a comma-separated list of
  9435.   field specifications. Lines are sorted by extracting and comparing
  9436.   the fields in the order specified until a comparison yields inequality.
  9437.   If a field exists in one line but not the other, the line that possesses
  9438.   the field wins. If neither line has a field, the lines are considered
  9439.   equal. Fields not sorted are output randomly (Sort is not a stable
  9440.   sort).
  9441.  
  9442.   Each of the field specifications takes one of the forms:
  9443.  
  9444.   [F][.C][-K][modifiers]
  9445.  
  9446.   [F][.C][+N][modifiers]
  9447.  
  9448.   F is a field number, C and -K are column numbers, and +N is a character
  9449.   count. Any of the items may be omitted, provided that at least one
  9450.   item appears. The numbers -K and +N are mutually exclusive. Spaces
  9451.   can appear anywhere in the specification (except within numbers),
  9452.   but they must be Shell-quoted.
  9453.  
  9454.   Fields are numbered from 1. A field is a string of characters surrounded
  9455.   by newlines or field separator characters (usually whitespace; see
  9456.   the -fs option). Typically field 1 would be the first word on the
  9457.   line, field 2 the second word, and so on. Field 0 represents the
  9458.   entire line and is the default if a field number is not specified.
  9459.   Field separator characters are treated as normal text (not separators)
  9460.   in field 0.
  9461.  
  9462.   Columns are numbered from 1. If .C is specified, it represents a
  9463.   starting offset into the field, taking into account the (file-dependent)
  9464.   varying width of tab characters, if necessary. .C defaults to 1 if
  9465.   it is not specified.
  9466.  
  9467.   If -K is specified it represents the last column to be included in
  9468.   the field. It defaults to infinity (the maximum K possible) if not
  9469.   specified. Except for field 0, fields are always terminated by field-separator
  9470.   characters, so a large K does not mean “the rest of the line.”
  9471.  
  9472.   If +N is specified, it represents the number of characters to be
  9473.   included in the field (this differs from -K in that tabs are always
  9474.   counted as single characters). It defaults to infinity (the maximum
  9475.   N possible) if not specified.
  9476.  
  9477.   Here is a short description of all possible field specifications:
  9478.  
  9479.     F         The entirety of field F.
  9480.     F.C       Columns C…∞ in field F.
  9481.     F.C-K     Columns C…K in field F.
  9482.     F.C+N     N characters starting at column C in field F.
  9483.     F-K       Columns 1…K in field F.
  9484.     F+N       The first N characters in field F.
  9485.     .C        Columns C…∞ in the whole line.
  9486.     .C-K      Columns C…K in the whole line.
  9487.     .C+N      N characters starting at column C in the whole line.
  9488.     -K        Columns 1…K in the whole line.
  9489.     +N        The first N characters of the whole line.
  9490.  
  9491.   A field specification may be followed by one or more modifier characters:
  9492.  
  9493.     r         Reverse order of comparison (reverses -r).
  9494.     b         Ignore leading blanks (reverses -b).
  9495.     q         Interpret quotes when extracting field (reverses -quote).
  9496.     d x t l u Treat field as decimal (d), hexadecimal (x), normal text
  9497.               (t), lowercase text (l) or uppercase text (u). These modifiers are
  9498.               mutually exclusive.
  9499.  
  9500.   These modifiers override the corresponding command line options on
  9501.   a field-by-field basis (r, q, and b flip the meaning of -r, -quote,
  9502.   and -b).
  9503.  
  9504.   When sorting multiple files, each file can have its own tab setting.
  9505.   When comparing column-aligned fields, Sort correctly handles tabs
  9506.   of varying width, even when comparing records from different files.
  9507.  
  9508.  
  9509.                              Examples
  9510.  
  9511.   Sort Able -stdin Baker -o Output
  9512.  
  9513.   Sort the files Able, Baker, and the standard input, with output to
  9514.   file Output.
  9515.  
  9516.   Sort -x -f '2.2+8, 1tr' Frog
  9517.  
  9518.   Sort the file Frog. The first key to sort on consists of eight characters
  9519.   starting at the second column of the second field, treated as a hexadecimal
  9520.   number. The second key to sort on is merely the text of the first
  9521.   field, in reverse order.
  9522.  
  9523.   Sort -p -merge -u one two three infinity
  9524.  
  9525.   Merge the specified files, treating lowercase characters as uppercase.
  9526.   Print version and progress information.
  9527.  
  9528. æKY StackWindows
  9529. æC             StackWindows -- arrange windows diagonally
  9530.  
  9531. StackWindows [-h num] [-v num] [-r top,left,bottom,right] [-i] [windows…]
  9532.  -h num                  # horizontal offset between windows
  9533.  -v num                  # vertical offset between windows
  9534.  -r t,l,b,r              # rectangle in which to stack windows
  9535.  -i                      # include the worksheet
  9536.  windows…                # list of windows to tile
  9537.  
  9538. Status codes returned:
  9539.   0    No errors.
  9540.   1    Syntax error (in parameters).
  9541.  
  9542.                            Description
  9543.  
  9544.   Automatically sizes and moves all of the open Shell windows (except
  9545.   the Worksheet) so that they are staggered diagonally across the screen.
  9546.   Use StackWindows when selecting windows from the Window menu; this
  9547.   makes dealing with many open windows easier.
  9548.  
  9549.   If no windows are specified, all open Shell windows (except the Worksheet)
  9550.   are stacked up. Additionally you can specify the horizontal and vertical
  9551.   staggering constants; otherwise staggering defaults to five pixels
  9552.   horizontally and 20 pixels vertically. You can also include the Worksheet
  9553.   by using the -i option.
  9554.  
  9555.  
  9556.                              Examples
  9557.  
  9558.   StackWindows
  9559.  
  9560.   Stacks all of the Shell windows, excluding the Worksheet, in a neat
  9561.   and orderly fashion.
  9562.  
  9563.   StackWindows -i -v 20 -h 10 {active} {target}
  9564.  
  9565.   Stacks the top two windows, including the Worksheet, with a vertical
  9566.   spacing of 20 pixels and a horizontal spacing of 10 pixels.
  9567.  
  9568.  
  9569.                              See also 
  9570.  
  9571.   MoveWindow, RotateWindow, SizeWindow, TileWindows, and ZoomWindow
  9572.   commands.
  9573.         
  9574. æKY StreamEdit
  9575. æC              StreamEdit -- scriptable text editor
  9576.  
  9577. StreamEdit [option…] file…
  9578.     -d                      # delete lines (don't copy them)
  9579.     -e statements           # add 'statements' to the script
  9580.     -o file                 # direct output to file in a "safe" manner
  9581.     -p                      # print progress information
  9582.     -s file                 # specify a file containing a script to execute
  9583.     -set variable[=string]  # set the value of a variable
  9584.  
  9585.     A script consists of zero or more of:
  9586.     
  9587.         <address> <command>…
  9588.  
  9589.     Addresses take the forms (highest to lowest precedence):
  9590.     
  9591.         ( address )             # override precedence
  9592.         ! address               # match line not matching the address
  9593.         address1 && address2    # match line matching address1 AND address2
  9594.         address1 || address2    # match line matching address1 OR address2
  9595.         address1 , address2     # match address1…address2
  9596.         /regular expression/    # a line that matches the expression
  9597.         •                       # matches BEFORE the first line
  9598.         N                       # matches the Nth line
  9599.         $                       # matches the last line
  9600.         ∞                       # matches AFTER the last line
  9601.  
  9602.     A regular expression starting with 'ç' is case-sensitive.  Any '•' must
  9603.     follow the 'ç'.
  9604.  
  9605.     Commands are:
  9606.     
  9607.         Append <text>           # append text to append buffer
  9608.         Exit [status]           # exit with zero or specified status
  9609.         Change <text>           # set contents of edit buffer
  9610.         Delete                  # clear contents of edit buffer
  9611.         Insert <text>           # append text to insert buffer
  9612.         Next                    # proceed with next line
  9613.         Print <text>            # Print the text
  9614.              [-To file ]        #    directed to the specified file
  9615.              [-AppendTo file]   #    appended to the specified file
  9616.         Replace /pat/ <text>    # do replacement
  9617.                 [-c count]      # specify repeat count (N or ∞)
  9618.         Set variable <text>     # set variable's value
  9619.             [-a]                #    append to variable's current value
  9620.             [-i]                #    insert at front of variable's current value
  9621.         Option AutoDelete       # append "1,$ Delete" to script
  9622.     
  9623.     Where <text> consists of zero or more of:
  9624.     
  9625.         "a string"              # the specified text
  9626.         'a string'              # the specified text
  9627.         .                       # the current line (the edit buffer)
  9628.         variableName            # the contents of the named string variable
  9629.         ®N                      # an "®" variable set by a regular expression
  9630.         -from <filename>        # the next line from the file, where filename
  9631.                                 #    is a string or a variable name
  9632.         -n                      # suppress newline at end
  9633.  
  9634.     If <text> is empty, it defaults to "." (the current line).
  9635.                 
  9636.                                            Description
  9637.                                                                                                                             
  9638. StreamEdit is an "offline" text editor similar to the Unix™ tool sed; it provides scriptable 
  9639. text matching and editing operations.  [It is not compatible with Unix™ sed or awk].  It is 
  9640. useful for making repetitive changes to files, for extracting information from text files, or 
  9641. as a filter.
  9642.  
  9643. StreamEdit takes a script and a set of input files (or standard input, if no input files are 
  9644. specified) and applies each statement in the script to each line of input, writing the output 
  9645. to standard output or the specified output file.
  9646.  
  9647. The script is specified by one or more -e or -s options.  If more than one script is 
  9648. specified, the resulting script is the concatenation of all the scripts.  If no script is 
  9649. specified (and -d is not specified), the script effectively defaults to
  9650.  
  9651.      1,$ Print
  9652.  
  9653. which has the effect of simply copying the input lines to the output.
  9654.  
  9655.  
  9656. A script consists of a series of statements of the form:
  9657.  
  9658.      address-expression command [ ; command … ]
  9659.  
  9660. Commands are separated by newlines or semi-colons.  All the commands following a 
  9661. particular address, up to the next address, are executed when the address matches.
  9662.  
  9663. A command takes the form:
  9664.  
  9665.      command-name [ text-arguments … ]
  9666.  
  9667. Arguments are terminated by newlines and semi-colons (while addresses may span 
  9668. multiple lines).
  9669.  
  9670. Address expressions, commands and command arguments are described below.
  9671.  
  9672.  
  9673. Empty lines are legal.  Comments begin with a sharp sign (#).  Semi-colons are equivalent 
  9674. to line breaks (unless they appear as the first character on a line), as in the Shell, and are 
  9675. used to terminate commands.  Newlines (outside of strings) may be escaped to extend an 
  9676. argument list.
  9677.  
  9678. If a script line contains a semi-colon in the first column, the entire line is treated as a 
  9679. comment by StreamEdit.  This allows you to write StreamEdit scripts that also contain 
  9680. MPW shell commands.  See the Examples section for more details.
  9681.  
  9682.                             Examples
  9683.                                                                                                                 
  9684.              Extracting the Leaf Part of a File Name
  9685.                                                     
  9686. It is sometimes necessary to extract the leaf part of a complete file path name in a Shell 
  9687. script.  The StreamEdit expression:
  9688.  
  9689. /(≈:)*([¬:]*)®1/
  9690.  
  9691. sets the variable ®1 to the part of the file name following the last colon, or the whole file 
  9692. name if there it doesn't contain a colon.  It could be used in a Shell script as a filter:
  9693.  
  9694. # {MPW}Scripts:FilterLeaf
  9695. StreamEdit -d -e '/(≈:)*([¬:]*)®1/ print ®1'
  9696.  
  9697. For example:
  9698.  
  9699. Echo "The:I:Is:Silent:myFile" | FilterLeaf
  9700.  
  9701. would print:
  9702.  
  9703. myFile
  9704.  
  9705.  
  9706.                     Generating Inlines
  9707.                                                                                 
  9708. This is a script that generates MPW C or C++ inline function declarations from assembly 
  9709. language source.  It's far easier and less error-prone than hand-assembly or cut-and-paste; 
  9710. even though this script depends on the format of the listing file produced by the MPW 
  9711. Assembler, it is better to automate the process.
  9712.  
  9713. The script's usage is:
  9714.  
  9715. MakeCInline assemblyfile.a >outputFile
  9716.  
  9717. Given assembler input something like this:
  9718.  
  9719. ;+
  9720. ;  Inline Pascal string copy
  9721. ;
  9722. ;¥ void pascal_string_copy(char* src, char* dest);
  9723. ;
  9724. ;-
  9725.     proc
  9726.     movem.l    (SP),A0-A1
  9727.     moveq    #0,D0
  9728.     move.b    (A1),D0
  9729.     bra.s    @2
  9730. @loop:    move.b    (A1)+,(A0)+
  9731. @2:    dbra    D0,@loop
  9732.     endproc
  9733.  
  9734. We want the filter to produce an inline declaration something like this:
  9735.  
  9736. void pascal_string_copy(char* src, char* dest) =
  9737. {0x4cef, 0x0300, 0x6b00, 0x1011, 0x6002, 0x10d9, 0x51c8, 0xfffc};
  9738.  
  9739. The character '¥' in the assembler comment marks the declaration; in principle any 
  9740. unique character or string can be used to flag the declaration.
  9741.  
  9742.  
  9743. The script has two parts; the first part contains MPW Shell commands, the rest of the 
  9744. script contains StreamEdit statements.
  9745.  
  9746. The MPW Shell part of the script is:
  9747.  
  9748. # MakeCInline -- make C assembly language inline declarations
  9749. ; asm "{1}" -l
  9750. ; StreamEdit -d -s "`which {0}`" "{1}".lst
  9751. ; Delete "{1}".lst "{1}".o
  9752. ; exit
  9753.  
  9754. It runs the assembler on the input file, producing a listing which is processed by the rest 
  9755. of the script.  Then the temporary files are removed and the MPW Shell part of the script 
  9756. exits; the Exit command ensures that the Shell doesn't execute any StreamEdit statements.
  9757.  
  9758. The invocation of StreamEdit here has an interesting hack; the name of the StreamEdit 
  9759. script to execute is, naturally, the name of the currently executing script.  So we use
  9760.  
  9761. `which {0}`
  9762.  
  9763. which expands into the name of the currently running shell script.
  9764.  
  9765.  
  9766. The rest of the file contains a StreamEdit script that processes the assembly listing 
  9767. produced above.  Here's an example of the assembler's listing output:
  9768.  
  9769. MC680xx Assembler - Ver 3.2d1          21-Nov-89  Page   1
  9770. Copyright Apple Computer, Inc. 1984-1989
  9771.  
  9772. Loc   F Object Code     Addr  MSource Statement
  9773.  
  9774.     case    on
  9775.     ;+
  9776.     ;
  9777.     ; ¥ void pascal_string_copy(char* src, char* dest)
  9778.     ;
  9779.     ;-
  9780. 00000                          strcpy    proc    export
  9781. 00000   4CD7 0300                  movem.l    (SP),A0-A1
  9782. 00004   7000                       moveq    #0,D0    
  9783. 00006   1011                       move.b    (A1),D0
  9784. 00008   6002        0000C          bra.s    @1
  9785. 0000A   10D9                   @loop:    move.b    (A1)+,(A0)+
  9786. 0000C G 51C8 FFFC   0000A      @1:    dbra    D0,@loop
  9787. 00010                                  endproc
  9788.  
  9789.                                    end
  9790.  
  9791. Elapsed time: 0.08 seconds.
  9792.  
  9793. Assembly complete - no errors found.  16 lines.
  9794.  
  9795.  
  9796.  
  9797. The opcodes we need are tantalizingly close … but embedded in goop that we need to 
  9798. strip away.  The first job is to extract the inline's declaration and copy it to the output.  
  9799. Hex constants must be separated by commas — we accomplish this with a variable, 
  9800. initially empty, that is set to a comma-and-space when a hex constant is emitted, so that a 
  9801. comma precedes every hex constant but the first one.
  9802.  
  9803. /;¥[ ∂t]*([¬;]*)®1/
  9804.     Print -n ®1 " =∂n{"
  9805.     Set PRECEEDING_COMMA ""
  9806.     Delete
  9807.  
  9808. The regular expression matches the inline declaration in the comment (which can be 
  9809. recognized by virtue of the marker string — "¥" — that we put there).  The text of the 
  9810. inline is extracted, omitting a possible trailing semicolon, and put into the variable ®1.  
  9811. The Print statement emits the inline declaration (in ®1) and extra stuff needed for C 
  9812. inline syntax.  The PRECEEDING_COMMA variable is set to empty, the line is deleted, 
  9813. and processing continues.
  9814.  
  9815.  
  9816. The inline declaration is terminated by an ENDP or an ENDPROC assembler directive:
  9817.  
  9818. /[ ∂t]ENDP/
  9819.     Print "};∂n"
  9820.     Delete
  9821.  
  9822. Next, totally uninteresting lines are deleted.  Examining the assembly listing, we note that 
  9823. the lines with the object code we need invariably contain a hex constant starting in the 
  9824. first column, several spaces (with an optional "G"), and at least one two-byte hex constant.  
  9825. We'll strip every line that doesn't meet these criteria, so there will be less noise to worry 
  9826. about.
  9827.  
  9828. !/•[0-9a-f]+ [ g] [0-9a-f]«4»/
  9829.     Delete
  9830.  
  9831. Then we simply delete any junk that precedes the hex constant we're interested in:
  9832.  
  9833. 1,$    Replace /[0-9a-f]+ [g ] /  ""
  9834.  
  9835. Now the line contains one word of assembler output that we can copy to the output:
  9836.  
  9837. /•([0-9a-f]«4»)®1 /
  9838.     Print -n PRECEEDING_COMMA "0x"®1
  9839.     Set PRECEEDING_COMMA ", "
  9840.     Replace // ""
  9841.  
  9842. We print an optional comma, followed by the hex constant itself.  Then we arrange for 
  9843. future constants to be preceded by a comma, and remove the constant from the front of 
  9844. the line.
  9845.  
  9846. Now we have a problem — there's no way to tell how many more constants have to be 
  9847. processed.  Furthermore, StreamEdit has no control structures for looping, so a count 
  9848. wouldn't help much anyway.  So we resort to a hack, namely, repeating the above code as 
  9849. many times as we're likely to ever need it for a single line of assembler output.
  9850.  
  9851. #
  9852. #  Convert remaining words
  9853. #  (I wish StreamEdit had looping!)
  9854. #
  9855. /•([0-9a-f]«4»)®1 /
  9856.     Print -n ", 0x"®1
  9857.     Replace // ""
  9858. /•([0-9a-f]«4»)®1 /
  9859.     Print -n ", 0x"®1
  9860.     Replace // ""
  9861. /•([0-9a-f]«4»)®1 /
  9862.     Print -n ", 0x"®1
  9863.     Replace // ""
  9864. /•([0-9a-f]«4»)®1 /
  9865.     Print -n ", 0x"®1
  9866.     Replace // ""
  9867.  
  9868. Examination of the assembler output shows that handling five constants on a line is more 
  9869. than enough.  However, if the assembler listing format changes, the script will break.
  9870.  
  9871.  
  9872.                       Unpacking Unix Shell Archives
  9873.                                                                                         
  9874. This script unpacks a Unix shell archive, more commonly known as a shar file.  Shar files 
  9875. are used in the Unix community to gather text (say, the sources for a program, including 
  9876. its makefile) into a single file, suitable for transmittal by electronic mail or usenet.
  9877.  
  9878. Shar files typically have the form:
  9879.  
  9880. garbage at the beginning — mail headers and so forth
  9881. sed "s/^X//" >TheFile <<'END_OF_TheFile '
  9882. Xtext of the file
  9883. X  where each line
  9884. X    is preceded by an 'X'
  9885. END_OF_TheFile 
  9886. more files, similarly packed
  9887.  
  9888. The Unix shell and the tool sed cooperate to strip off the 'X's at the beginning of each 
  9889. line, and to direct the output to the correct file.  Unfortunately the MPW Shell does not 
  9890. have this kind of redirection, and StreamEdit is not sed, so we have to come up with our 
  9891. own solution.
  9892.  
  9893. To make matters worse, there is no single format for a shar file — in the Unix community 
  9894. it's "anything goes", as long as the standard Unix tools can unpack it.  A StreamEdit script 
  9895. to unpack an arbitrary shar file would have to closely emulate the Unix environment, 
  9896. which is rather difficult.  In practice, you'll have to tweak this script to handle different 
  9897. kinds of shar files.
  9898.  
  9899.  
  9900. The script starts with the usual MPW Shell commands to start up StreamEdit with the 
  9901. proper script, pass along the command-line parameters, and exit.  No surprises:
  9902.  
  9903. ; streamedit -d -s `which "{0}"` {parameters}
  9904. ; exit
  9905.  
  9906.  
  9907. The variable FILE holds the name of the current output file.  When we see a line beginning 
  9908. with "sed", we extract the output filename (possibly enclosed in quotes) and put it in the 
  9909. variable.
  9910.  
  9911. •    Set FILE "DELETE.ME"            # for safety's sake
  9912.  
  9913. /•sed/ &&   (    />[ ∂t]*∂'([¬ ∂t]*)®1∂' /    # sed … >'quotedFile'
  9914.         ||
  9915.         />[ ∂t]*([¬ ∂t>]*)®1 /    # sed … >notQuotedFile
  9916.          )
  9917.     Set FILE ®1
  9918.     print "Extracting " FILE
  9919.  
  9920. For paranoia's sake, the FILE variable is initialized to "DELETE.ME", and the name of each 
  9921. file extracted is printed on standard output.
  9922.  
  9923. Extraction is simple — for every line beginning with an "X", the "X" is stripped off and the 
  9924. line is written to the current destination file.
  9925.  
  9926. /•X/
  9927.     replace // ""
  9928.     print -to FILE
  9929.     
  9930.                              See also
  9931.                                                                                                                         
  9932. Shell documentation on regular expressions.                                                                                                                        
  9933.     
  9934. æKY Target
  9935. æC              Target -- make a window the target window
  9936.  
  9937. Target name
  9938.  
  9939. Status codes returned:
  9940.   0    No errors.
  9941.   1    Error in parameters.
  9942.   2    The specified file does not exist.
  9943.   3    System error.
  9944.  
  9945.                            Description
  9946.  
  9947.   Makes window name the target window for editing commands (that is,
  9948.   the second window from the front). If window name isn’t already open,
  9949.   then file name is opened as the target window. If name doesn’t exist,
  9950.   an error is returned.
  9951.  
  9952.  
  9953.                              Examples
  9954.  
  9955.   Target Sample.a
  9956.  
  9957.   Makes the window Sample.a the target window.
  9958.  
  9959.  
  9960.                              See also 
  9961.  
  9962.   Open command.
  9963.  
  9964.   “Editing With the Command Language” in Chapter 5.
  9965.  
  9966. æKY TileWindows
  9967. æC          TileWindows -- arrange windows in a tiled fashion
  9968.  
  9969. TileWindows [-h | -v] [-r top,left,bottom,right] [-i] [windows…]
  9970.  -h                      # tile windows horizontally
  9971.  -v                      # tile windows vertically
  9972.  -r t,l,b,r              # rectangle in which to tile windows
  9973.  -i                      # include the worksheet
  9974.  windows…                # list of windows to tile
  9975.  
  9976. Status codes returned:
  9977.   0    No errors.
  9978.   1    Syntax error (error in parameters).
  9979.  
  9980.                            Description
  9981.  
  9982.   TileWindows automatically sizes and moves the specified Shell windows
  9983.   so that they are all visible on the screen at once. If no windows
  9984.   are specified, all open windows are tiled (except the Worksheet).
  9985.   Arranging your open windows like tiles and then zooming a selected
  9986.   window to full size makes dealing with many open windows much easier.
  9987.  
  9988.  
  9989.                              Examples
  9990.  
  9991.   TileWindows
  9992.  
  9993.   Arranges all of the Shell windows in a tile pattern, so that all
  9994.   are visible.
  9995.  
  9996.   TileWindows -h hd:new:main.c hd:new:foo.c
  9997.  
  9998.   Arranges the specified windows as two long horizontal strips.
  9999.  
  10000.   TileWindows -v {active} {target}
  10001.  
  10002.   Arranges the top two windows vertically.
  10003.  
  10004.  
  10005.                              See also 
  10006.  
  10007.   MoveWindow, RotateWindow, SizeWindow, StackWindows, and ZoomWindow
  10008.   commands.
  10009.  
  10010. æKY TransferCkid
  10011. æC  TransferCkid -- move Projector information from one file to another
  10012.  
  10013. TransferCkid sourceFile destinationFile 
  10014.  
  10015. Status codes returned:
  10016.   0    No errors.
  10017.   1    Syntax error.
  10018.   2    Error in processing.
  10019.  
  10020.                            Description
  10021.  
  10022.   Move the Projector 'CKID' resource from sourcefile to destinationfile.
  10023.  
  10024.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  10025.   symbols used in Projector commands.
  10026.  
  10027. æKY Translate
  10028. æC                  Translate -- translate characters
  10029.  
  10030. Translate [-p] [-s] src [dst] < file > output ≥ progress
  10031.     -p                    # write progress information to diagnostics
  10032.     -s                    # set font, font size, and tab setting of output
  10033.  
  10034. Status codes returned:
  10035.   0    Normal termination.
  10036.   1    Parameter or option error.
  10037.  
  10038.                            Description
  10039.  
  10040.   Standard input is copied to standard output, with input characters
  10041.   specified in the src (source) parameter string mapped into the corresponding
  10042.   characters specified by the dst (destination) parameter string; all
  10043.   other characters are copied as is. If dst is omitted, all characters
  10044.   represented by the src are deleted. If the dst string is shorter
  10045.   than the src, all characters in the src that would map to or beyond
  10046.   the last character in the dst are mapped into the last character
  10047.   in dst, and adjacent instances of such characters in the input are
  10048.   represented by a single instance of the last character in dst.
  10049.  
  10050.   Both src and dst are specified as a standard Shell character list
  10051.   but not enclosed in square brackets. Thus the src and dst are sequences
  10052.   of one or more characters (that is, an abcde) or a range of characters
  10053.   separated by a minus sign (that is, a–z, 0–9). Standard escape characters
  10054.   (such as ,
  10055.  
  10056.     • Note: Case sensitivity of letters specified in the src list
  10057.     are governed by the {CaseSensitive} Shell variable. If CaseSensitive
  10058.     is set to 1, then only letters specified in the src are mapped
  10059.     or deleted. If CaseSensitive is 0, then uppercase and lowercase
  10060.     letters not explicitly mapped into dst characters are mapped
  10061.     identically.
  10062.  
  10063.  
  10064.                              Examples
  10065.  
  10066.   translate a-z A-Z <origFile >ucFile
  10067.  
  10068.   Converts all lowercase letters in origFile to uppercase and writes
  10069.   the translated file to ucFile.
  10070.  
  10071.   translate 0-9 9 <origFile >outFile
  10072.  
  10073.   Converts each string of digits in origFile to the single digit 9
  10074.   in outFile.
  10075.  
  10076.   translate  
  10077.  
  10078.   Converts each run of blanks, tabs, or newline (return) characters
  10079.   in origFile to a single newline character in outFile. This effectively
  10080.   produces an output with just one word on each line. Note that the
  10081.   src string had to be quoted to specify the blank.
  10082.  
  10083.   translate ¬a-zA-Z    <origFile >outFile
  10084.  
  10085.   Removes all punctuation and isolates words by spaces on each line.
  10086.   Here we negated the src character list. Thus all characters except
  10087.   letters and newline characters are replaced with spaces.
  10088.  
  10089. æKY Unalias
  10090. æC                      Unalias -- remove aliases
  10091.  
  10092. Unalias [name…]
  10093.  
  10094. Status codes returned:   
  10095.   0    no errors.
  10096.  
  10097.                            Description
  10098.  
  10099.   Removes any alias definition associated with the alias name. (It
  10100.   is not an error if no definition exists for name.)
  10101.  
  10102.   s Caution If no names are specified, all aliases are removed.  s
  10103.  
  10104.   The scope of the Unalias command is limited to the current script;
  10105.   that is, aliases in enclosing scripts are not affected. If you are
  10106.   writing a script that is to be completely portable across various
  10107.   users’ configurations of MPW, you should place the command
  10108.  
  10109.   Unalias
  10110.  
  10111.   at the beginning of your script to make sure no unwanted substitutions
  10112.   occur.
  10113.  
  10114.  
  10115.                              Examples
  10116.  
  10117.   Unalias File
  10118.  
  10119.   Remove the alias “File”. (This alias is defined in the Startup file.)
  10120.  
  10121.  
  10122.                              See also 
  10123.  
  10124.   Alias command.
  10125.  
  10126.   “Command Aliases” in Chapter 5.
  10127.  
  10128. æKY Undo
  10129. æC                     Undo -- undo the last edit
  10130.  
  10131. Undo [window]
  10132.  
  10133. Status codes returned:
  10134.   0    No errors.
  10135.   1    Syntax error (error in parameters).
  10136.   2    Any other error.
  10137.  
  10138.                            Description
  10139.  
  10140.   Undo is the scriptable equivalent of choosing Undo from the Edit
  10141.   menu to reverse the last editing operation. Undo without any parameters
  10142.   acts on the target (that is, the second from the front) window. Optionally
  10143.   a named window can be specified.
  10144.  
  10145.     • Note: Remember that Undo is maintained on a window-by-window
  10146.     basis. Therefore using this command will undo the last edit operation
  10147.     that was performed in the specified window, which may or may
  10148.     not be the last operation actually performed.
  10149.  
  10150.  
  10151.                              Examples
  10152.  
  10153.   Undo
  10154.  
  10155.   Reverses the last edit operation in the target window.
  10156.  
  10157.   Undo {Worksheet}
  10158.  
  10159.   Reverses the last edit operation in the Worksheet window.
  10160.  
  10161.  
  10162.                              See also 
  10163.  
  10164.   Cut, Copy, and Paste commands.
  10165.  
  10166. æKY Unexport
  10167. æC     Unexport -- remove variable definitions from the export list
  10168.  
  10169. Unexport [-r | -s | name…]   > unexports
  10170.  -r                      # generate Export commands for all unexported variables
  10171.  -s                      # print the names only
  10172.  
  10173. Status codes returned:
  10174.   0    No error.
  10175.   1    Syntax error.
  10176.  
  10177.                            Description
  10178.  
  10179.   Removes the specified variables from the list of exported variables.
  10180.   The list of exported variables is local to a script, so unexported
  10181.   variables are removed only from the local list.
  10182.  
  10183.   If no names are specified, a list of unexported variables is written
  10184.   to standard output. The default output of Unexport is in the form
  10185.   of Unexport commands.
  10186.  
  10187.   (A variable that is not exported is considered unexported.)
  10188.  
  10189.  
  10190.                              Examples
  10191.  
  10192.   Set SrcDir HD:source:
  10193.   Export SrcDir # SrcDir is available to scripts and tools
  10194.   …
  10195.   Unexport SrcDir
  10196.  
  10197.   Now the variable SrcDir is no longer available to scripts and tools.
  10198.  
  10199.   Unexport -r
  10200.   Export var1
  10201.   Export var2
  10202.   …
  10203.  
  10204.   This example lists all the variables that are not exported. To export
  10205.   them, simply select and execute all the export commands.
  10206.  
  10207.   To get a list of all the variables that have not been exported, execute
  10208.   this command:
  10209.  
  10210.   Unexport -s
  10211.   var1
  10212.   var2
  10213.   ...
  10214.   varx
  10215.  
  10216.  
  10217.                              See also 
  10218.  
  10219.   Set and Export commands.
  10220.  
  10221. æKY Unmark
  10222. æC               Unmark -- remove a marker from a window
  10223.  
  10224. Unmark name… window
  10225.  
  10226. Status codes returned:
  10227.   0    No errors.
  10228.   1    Syntax error.
  10229.   2    Error in processing.
  10230.   3    System error.
  10231.  
  10232.                            Description
  10233.  
  10234.   Unmark removes the marker(s) name… , from the list of markers available
  10235.   for window. When a window is the current active window, the Mark
  10236.   menu item(s) will be adjusted.
  10237.  
  10238.  
  10239.                              Examples
  10240.  
  10241.   Unmark `Markers` {Target}
  10242.  
  10243.   Removes all markers associated with the target window.
  10244.  
  10245.   Unmark Proc1 {Active}
  10246.  
  10247.   Removes the “Proc1” marker from the active window’s marker list.
  10248.   Because {Active} is by definition the current active window, the
  10249.   Mark menu is also adjusted to reflect the deletion of the “Proc1”
  10250.   marker.
  10251.  
  10252.   Limitation Unmark does not support Undo.
  10253.  
  10254.  
  10255.                              See also 
  10256.  
  10257.   “Markers” in Chapter 6.
  10258.  
  10259. æKY Unmount
  10260. æC                     Unmount -- unmount volumes
  10261.  
  10262. Unmount volume…
  10263.  
  10264. Status codes returned:
  10265.   0    The volume was successfully unmounted.
  10266.   1    Syntax error.
  10267.   2    An error occurred.
  10268.  
  10269.                            Description
  10270.  
  10271.   Unmounts the specified volumes. A volume name must end with a colon
  10272.   ( : ). If volume is a number without a colon, it’s interpreted as
  10273.   a disk drive number. The unmounted volumes cannot be referenced again
  10274.   until remounted. If you unmount the current volume (the volume containing
  10275.   the current directory), the boot volume becomes the current volume.
  10276.  
  10277.  
  10278.                              Examples
  10279.  
  10280.   Unmount Memos:
  10281.  
  10282.   Unmounts the volume titled Memos.
  10283.  
  10284.   Unmount 1 2
  10285.  
  10286.   Unmounts the volumes in drives 1 (the internal drive) and 2 (the
  10287.   external drive). (The command Eject 1 2 would unmount and eject the
  10288.   volumes.)
  10289.  
  10290.  
  10291.                              See also 
  10292.  
  10293.   Eject and Mount commands.
  10294.  
  10295. æKY UnmountProject
  10296. æC                 UnmountProject -- unmount projects
  10297.  
  10298. UnmountProject -a | Project…
  10299.  -a                      # unmount all mounted projects
  10300.  
  10301. Status codes returned:
  10302.   0    No errors.
  10303.   1    Syntax error.
  10304.   2    Error in processing.
  10305.   3    System error.
  10306.  
  10307.                            Description
  10308.  
  10309.   Unmount projects mounted under Projector.
  10310.  
  10311.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  10312.   symbols used in Projector commands.
  10313.  
  10314.  
  10315.                              Examples
  10316.  
  10317.   To unmount all mounted projects use:
  10318.  
  10319.   UnmountProject -a
  10320.  
  10321.   To unmount the projects MyProject and YourProject use:
  10322.  
  10323.   UnmountProject MyProject YourProject
  10324.  
  10325.  
  10326.                              See also 
  10327.  
  10328.   MountProject.
  10329.  
  10330. æKY Unset
  10331. æC              Unset -- remove Shell variable definitions
  10332.  
  10333. Unset [name…]
  10334.  
  10335. Status codes returned:
  10336.  0    no errors.
  10337.  
  10338.                            Description
  10339.  
  10340.   Removes any variable definition associated with name. (It’s not an
  10341.   error if no definition exists for name.)
  10342.  
  10343.   • Caution If no names are specified, all variable definitions are
  10344.   removed. This can have serious consequences. For example, the Shell
  10345.   uses the variable {Commands} to locate utilities and applications
  10346.   and uses several other variables to set defaults. The assembler and
  10347.   compilers use variables to help locate include files. (For details,
  10348.   see “Variables Defined in the Startup File” in Chapter 5 of the MPW
  10349.   manual.)
  10350.  
  10351.   The scope of the Unset command is limited to the current script;
  10352.   that is, variables in enclosing scripts are not affected.
  10353.  
  10354.  
  10355.                              Examples
  10356.  
  10357.   Unset CaseSensitive
  10358.  
  10359.   Removes the variable definition for {CaseSensitive}. This turns off
  10360.   case-sensitive searching for the editing commands.
  10361.  
  10362.  
  10363.                              See also 
  10364.  
  10365.   Set, Export, and Unexport commands.
  10366.  
  10367.   “Defining and Redefining Variables” in Chapter 5.
  10368.  
  10369. æKY UserVariables
  10370. æC     UserVariables -- uses Commando to set all the user variables
  10371.  
  10372. æKY Version
  10373. æC                Version -- print the version of the MPW Shell
  10374.  
  10375. æKY Volumes
  10376. æC                   Volumes -- list mounted volumes
  10377.  
  10378. Volumes [-l] [-q] [volume…]  > volumeList
  10379.  -l                      # long format (name, drive, size, free, files, dirs)
  10380.  -q                      # don't quote volume names with special characters
  10381.  
  10382. Status codes returned:
  10383.   0    No errors.
  10384.   1    Syntax error.
  10385.   2    No such volume.
  10386.  
  10387.                            Description
  10388.  
  10389.   For each volume named, Volumes writes its name and any other information
  10390.   requested to standard output. The output is sorted alphabetically.
  10391.   A volume name must end with a colon ( : )—if volume is a number without
  10392.   a colon, it’s interpreted as a disk drive number. If volume is not
  10393.   given, all mounted volumes are listed.
  10394.  
  10395.  
  10396.                              Examples
  10397.  
  10398.   Volumes -l
  10399.  
  10400.   will write information such as
  10401.  
  10402.   Name   Drive   Size    Free   Files  Dirs
  10403.   _____ ______  _____   _____  ______ _____
  10404.   HD:      3    19171K  14242K    290   33
  10405.  
  10406.   Files `Volumes 1`
  10407.  
  10408.   Lists the files on the disk in drive 1 (the built-in 3.5-inch disk
  10409.   drive).
  10410.  
  10411. æKY WhereIs
  10412. æC               WhereIs  -- find the location of a file
  10413.  
  10414. WhereIs [-c] [-d] [-v] [-s directory]… pattern
  10415.  -c                      # completely match filepattern
  10416.  -d                      # include directories
  10417.  -v                      # verbose output - put summary line at end
  10418.  -s directory            # starting directory/volume for search
  10419.  
  10420. Status codes returned:
  10421.   0    No errors.
  10422.   1    Syntax error.
  10423.   2    File system error during processing.
  10424.   3    No matches were found.
  10425.  
  10426.                            Description
  10427.  
  10428.   Use WhereIs to find the location of all files that contain pattern
  10429.   as part of their filename. You can use WhereIs to find files hidden
  10430.   in the directory tree. Pattern is a full or partial filename. For
  10431.   example, a pattern of “test” will match TestProg.c, test.c, and Work:OutputTest.
  10432.   WhereIs starts searching in the root directory of the default volume
  10433.   and searches the entire disk. To constrain the search to a portion
  10434.   of a disk, or to specify different disks or multiple disks, use the
  10435.   -s option. To list any directories that contain pattern, use the
  10436.   -d option. To constrain the search to files that completely match
  10437.   pattern, use the -c option. The -v option prints the number of items
  10438.   matched with pattern. Matching is not case sensitive, and regular
  10439.   expressions are not supported.
  10440.  
  10441.   WhereIs lists the full pathname of all files and directories found.
  10442.   Files that contain special characters are quoted.
  10443.  
  10444.  
  10445.                              Examples
  10446.  
  10447.   WhereIs test
  10448.  
  10449.   Find all files that have “test” in their filename. The output would
  10450.   be something like
  10451.  
  10452.   HD:MPW:test.c
  10453.   HD:MPW:test.c.o
  10454.   HD:MPW:TestMenu.c
  10455.   HD:MPW:TestProg.p
  10456.  
  10457.   WhereIs -c test.c
  10458.  
  10459.   Find files named test.c. The output (with the same files as the example
  10460.   above) would be
  10461.  
  10462.   HD:MPW:test.c
  10463.  
  10464.   WhereIs -d test
  10465.  
  10466.   Find all files or directories that have “test” in their leafname.
  10467.   The output would be
  10468.  
  10469.   HD:MPW:TestDir:
  10470.   HD:MPW:test.c
  10471.   HD:MPW:test.c.o
  10472.   HD:MPW:TestMenu.c
  10473.   HD:MPW:TestProg.p
  10474.  
  10475.   WhereIs -s HD:MPW -s Disk2:Work test
  10476.  
  10477.   Find all files that have “test” in their pathname. Search for the
  10478.   files starting in HD:MPW and also in Disk2:Work.
  10479.  
  10480. æKY Which
  10481. æC         Which -- determine which file the shell will execute
  10482.  
  10483. Which [-a] [-p] [name]  > file ≥ progress
  10484.  -a                      # report all commands named "name"
  10485.  -p                      # writes progress information to diagnostics
  10486.  
  10487. Status codes returned:
  10488.   0    No error.
  10489.   1    Syntax error.
  10490.   2    Command not found.
  10491.   3    Other error.
  10492.  
  10493.                            Description
  10494.  
  10495.   Determines which command the Shell will execute when command is entered.
  10496.   Which looks for commands defined by aliases, Shell built-in commands,
  10497.   and commands accessible through the Shell variable {Commands} (the
  10498.   same order the Shell uses). If command is not specified, all paths
  10499.   in the {Commands} variable will be written to standard output, one
  10500.   directory per line. The directories are listed in the order in which
  10501.   the Shell would search for commands. In this case the -a and -p options
  10502.   have no meaning.
  10503.  
  10504.  
  10505.                              Examples
  10506.  
  10507.   Which asm
  10508.  
  10509.   This command outputs something like - HD:MPW:Tools:asm. The Shell
  10510.   then executes hd:MPW:Tools:asm when given asm.
  10511.  
  10512.   Which -a makeit
  10513.   Alias makeit 'make > tmp; tmp'
  10514.   HD:MPW:Tools:makeit
  10515.   HD:MPW:Scripts:makeit
  10516.  
  10517.   In this case, there are three different “makeit” commands that the
  10518.   Shell could execute, as determined by current aliases and the {Commands}
  10519.   variable. The Shell executes the first one found (the alias).
  10520.  
  10521.   Which newfolder
  10522.  
  10523.   newfolder
  10524.  
  10525.   In this case, newfolder is a Shell built-in command.
  10526.  
  10527. æKY Windows
  10528. æC                      Windows  -- list windows
  10529.  
  10530. Windows [-q]
  10531.  -q                      # don't quote window names with special characters
  10532.     -o                      # list "Open" command lines for execution
  10533.  
  10534. Status codes returned:
  10535.   0    No error.
  10536.   1    Syntax error.
  10537.  
  10538.                            Description
  10539.  
  10540.   Writes the full pathname of each file currently in a window. The
  10541.   names are written to standard output, one per line, from backmost
  10542.   to frontmost.
  10543.  
  10544.  
  10545.                              Examples
  10546.  
  10547.   Windows
  10548.  
  10549.   Lists the pathnames of all open windows.
  10550.  
  10551.   Print {PrintOptions} `Windows`
  10552.  
  10553.   Prints the pathnames of the open windows, using the options specified
  10554.   by the {PrintOptions} variable. This example uses command substitution:
  10555.   Because the Windows command appears in backquotes (`…`), its output
  10556.   supplies the parameters to the Print command.
  10557.  
  10558.   Echo “Open `Windows` || Set Status 0” > SavedWindows
  10559.  
  10560.   Writes a script in the file SavedWindows that will reopen the current
  10561.   set of open windows. Notice how Echo is used to create the script.
  10562.   The conditional || execution operator restores the status to zero
  10563.   should an error occur while opening the remembered windows. This
  10564.   technique is used in the script Suspend to save the list of open
  10565.   windows.
  10566.  
  10567. æKY ZoomWindow
  10568. æC           ZoomWindow -- enlarge or reduce a window's size
  10569.  
  10570. ZoomWindow [-b | -s] [window]
  10571.  -b                      # zoom to full screen (big)
  10572.  -s                      # zoom back to regular size (small)
  10573.  
  10574. Status codes returned:
  10575.   0    No errors.
  10576.   1    Syntax error (error in parameters).
  10577.   2    The specified window does not exist.
  10578.  
  10579.                            Description
  10580.  
  10581.   Zooms the specified window according to the option specified. The
  10582.   default window is the target (second from the front) window; a specific
  10583.   window can optionally be specified. The -s option forces the window
  10584.   to zoom back to its small size. The -b option forces the window to
  10585.   zoom to its full size. If no option is specified, the window toggles
  10586.   to the other size. ZoomWindow without any options mimics the operation
  10587.   of clicking in the window’s zoom box. This command is especially
  10588.   valuable when used in conjunction with StackWindows or TileWindows.
  10589.  
  10590.                              Examples
  10591.  
  10592.   ZoomWindow
  10593.  
  10594.   Zooms the target window to full screen size if the window was originally
  10595.   in the small size.
  10596.  
  10597.   ZoomWindow -s {Worksheet}
  10598.  
  10599.   Zooms the Worksheet window back to its small size.
  10600.  
  10601.  
  10602.                              See also 
  10603.  
  10604.   MoveWindow, RotateWindows, SizeWindow, StackWindows, and TileWindows
  10605.   commands.
  10606.  
  10607.   {ZoomWindowRect} variable in Chapter 5.
  10608.  
  10609.   The “full size” window is normally the entire screen. You can change
  10610.   it (for example, prevent it from covering the disk and trash icons)
  10611.   by specifying a rectangle in the Shell variable {ZoomWindowRect}.
  10612.